Ignore:
Timestamp:
Oct 15, 2013, 2:52:17 PM (11 years ago)
Author:
Antonio Araujo Brett <aaraujo@…>
Branches:
master
Children:
4528953
Parents:
56b06e2
Message:

*- Agregada actividad FileToShareActivity? para compartir archivos a través de otras aplicaciones. Se pueden compartir archivos firmados, archivos BDOC descargados de servidores y archivos extraídos de BDOC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TibisayMovil/src/ve/gob/cenditel/tibisaymovil/TibisayMovilActivity.java

    r5147e01 r6b383b3  
    5252                final AlertDialog sign_dialog = makeSignatureOptionsDialog();
    5353               
     54                //Crear dialogo de opciones para compartir archivo
     55                final AlertDialog share_dialog = makeShareOptionsDialog();
    5456                       
    5557               
     
    99101                                }
    100102                               
     103                                // seleccion de compartir archivo
     104                                if (function.equals(getString(R.string.compartir))){
     105                                        Toast.makeText(context, "Compartir Archivo", duration).show();
     106                                        share_dialog.show();
     107                               
     108                                }
     109                               
    101110                        }
    102111                }); //setOnItemClickListener
     
    154163        }
    155164       
     165        private void shareFile(String path){
     166                Intent intent = new Intent(this, FileToShareActivity.class);
     167               
     168                intent.putExtra("path", path);
     169               
     170                startActivity(intent);
     171        }
     172       
    156173        //Crea dialogo de opciones para firma electronica
    157174        public AlertDialog makeSignatureOptionsDialog() {
     
    187204                return builder.create();
    188205        }
     206       
     207        //Crea dialogo de opciones para firma electronica
     208        public AlertDialog makeShareOptionsDialog() {
     209                final String[] option = new String[] {getString(R.string.share_pdf_signed),
     210                                getString(R.string.share_bdoc_downloaded), getString(R.string.share_extracted_file_from_bdoc) };
     211                ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
     212                        android.R.layout.select_dialog_item, option);
     213                AlertDialog.Builder builder = new AlertDialog.Builder(this);
     214               
     215                builder.setTitle(getString(R.string.seleccione_opcion));
     216                builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
     217               
     218                  public void onClick(DialogInterface dialog, int which) {
     219                         
     220                          switch (which) {
     221                        case 0: // Archivo Firmado
     222                                Log.i("DEBUG", "antes de activity call");
     223                                shareFile("archivoFirmado");
     224                                break;
     225                        case 1: // Archivos BDOC Descargados
     226                                shareFile("bdocDescargado");
     227                                break;
     228                        case 2: // Archivos extraídos de BDOC
     229                                shareFile("extraidoDeBdoc");
     230                                break;
     231
     232                        default:
     233                                break;
     234                        }
     235                  }
     236                 
     237                });     
     238               
     239                return builder.create();
     240        }
     241       
    189242}
Note: See TracChangeset for help on using the changeset viewer.