Foros del Web » Programando para Internet » Android »

Buscar Fotografia en otra ruta

Estas en el tema de Buscar Fotografia en otra ruta en el foro de Android en Foros del Web. Hola amigos del foro tengo un detalle con este codigo en realidad todo funciona perfectamente pero lo que necesito es que al precionar un boton ...
  #1 (permalink)  
Antiguo 08/11/2015, 20:47
Avatar de joseanguiano  
Fecha de Ingreso: agosto-2015
Ubicación: Coatzacoalcos
Mensajes: 87
Antigüedad: 8 años, 7 meses
Puntos: 1
Pregunta Buscar Fotografia en otra ruta

Hola amigos del foro tengo un detalle con este codigo en realidad todo funciona perfectamente pero lo que necesito es que al precionar un boton me busque imagenes en otra ruta que no sea en la Galeria ya que actualmente me busca la imagenes pero en la galeria y yo lo que quiero es que me busque las imagenes es esta ruta

Código HTML:
/images/fotouno.jpg
Código Java:
Ver original
  1. public class EnviarFotoEntrada extends Activity {
  2.  
  3.     private ShareActionProvider myShareActionProvider;
  4.  
  5.     EditText edittextEmailAddress;
  6.     EditText edittextEmailSubject;
  7.     EditText edittextEmailText;
  8.     TextView textImagePath;
  9.     Button buttonSelectImage;
  10.  
  11.     final int RQS_LOADIMAGE = 0;
  12.  
  13.     Uri imageUri = null;
  14.  
  15.     @Override
  16.     public void onCreate(Bundle savedInstanceState) {
  17.         super.onCreate(savedInstanceState);
  18.         setContentView(R.layout.enviar_foto_entrada);
  19.  
  20.         edittextEmailAddress = (EditText) findViewById(R.id.email_address);
  21.         edittextEmailSubject = (EditText) findViewById(R.id.email_subject);
  22.         edittextEmailText = (EditText) findViewById(R.id.email_textx);
  23.         edittextEmailAddress.addTextChangedListener(commonTextWatcher);
  24.         edittextEmailSubject.addTextChangedListener(commonTextWatcher);
  25.         edittextEmailText.addTextChangedListener(commonTextWatcher);
  26.  
  27.         textImagePath = (TextView) findViewById(R.id.imagepath);
  28.  
  29.         buttonSelectImage = (Button) findViewById(R.id.selectimage);
  30.         buttonSelectImage.setOnClickListener(buttonSelectImageOnClickListener);
  31.  
  32.         Toast.makeText(
  33.                 getApplicationContext(),
  34.                 "¡Selecciona tu imagen, y enviala al correo electronico proporcionado por el administrador!",
  35.                 Toast.LENGTH_LONG).show();
  36.     }
  37.  
  38.     TextWatcher commonTextWatcher = new TextWatcher() {
  39.  
  40.         @Override
  41.         public void afterTextChanged(Editable s) {
  42.             // TODO Auto-generated method stub
  43.             setShareIntent(createShareIntent());
  44.         }
  45.  
  46.         @Override
  47.         public void beforeTextChanged(CharSequence s, int start, int count,
  48.                 int after) {
  49.             // TODO Auto-generated method stub
  50.  
  51.         }
  52.  
  53.         @Override
  54.         public void onTextChanged(CharSequence s, int start, int before,
  55.                 int count) {
  56.             // TODO Auto-generated method stub
  57.  
  58.         }
  59.     };
  60.  
  61.     OnClickListener buttonSelectImageOnClickListener = new OnClickListener() {
  62.  
  63.         @Override
  64.         public void onClick(View arg0) {
  65.             Intent intent = new Intent(
  66.                     Intent.ACTION_PICK,
  67.                     android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  68.             startActivityForResult(intent, RQS_LOADIMAGE);
  69.         }
  70.     };
  71.  
  72.     @Override
  73.     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  74.         // TODO Auto-generated method stub
  75.         super.onActivityResult(requestCode, resultCode, data);
  76.  
  77.         if (resultCode == RESULT_OK) {
  78.             switch (requestCode) {
  79.             case RQS_LOADIMAGE:
  80.                 imageUri = data.getData();
  81.                 textImagePath.setText(imageUri.toString());
  82.                 setShareIntent(createShareIntent());
  83.                 break;
  84.             }
  85.         }
  86.     }
  87.  
  88.     @Override
  89.     public boolean onCreateOptionsMenu(Menu menu) {
  90.         getMenuInflater().inflate(R.menu.enviar_foto_entrada, menu);
  91.  
  92.         MenuItem item = menu.findItem(R.id.menu_item_share);
  93.         myShareActionProvider = (ShareActionProvider) item.getActionProvider();
  94.         myShareActionProvider
  95.                 .setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
  96.         myShareActionProvider.setShareIntent(createShareIntent());
  97.         return true;
  98.     }
  99.  
  100.     private Intent createShareIntent() {
  101.         String emailAddress = edittextEmailAddress.getText().toString();
  102.         String emailSubject = edittextEmailSubject.getText().toString();
  103.         String emailText = edittextEmailText.getText().toString();
  104.         String emailAddressList[] = { emailAddress };
  105.  
  106.         Intent shareIntent = new Intent(Intent.ACTION_SEND);
  107.  
  108.         shareIntent.putExtra(Intent.EXTRA_EMAIL, emailAddressList);
  109.         shareIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
  110.         shareIntent.putExtra(Intent.EXTRA_TEXT, emailText);
  111.  
  112.         if (imageUri != null) {
  113.             shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
  114.             shareIntent.setType("image/png");
  115.         } else {
  116.             shareIntent.setType("plain/text");
  117.         }
  118.  
  119.         return shareIntent;
  120.     }
  121.  
  122.     private void setShareIntent(Intent shareIntent) {
  123.         if (myShareActionProvider != null) {
  124.             myShareActionProvider.setShareIntent(shareIntent);
  125.         }
  126.  
  127.     }
  128.  
  129.     public void salircom(View v) {
  130.         Intent salircom = new Intent(this, Home.class);
  131.         startActivity(salircom);
  132.     }
  133. }

Actualmente estoy trabajando con android y solo necesito eso, mas sin embargo no s donde colocar esa ruta alguien me puede ayudar gracias y saludos
espero me puedan echar una mano
__________________
Lo fácil, ya lo hice, lo difícil lo estoy haciendo y lo imposible, me tardare pero lo lograre.
  #2 (permalink)  
Antiguo 11/11/2015, 09:22
Avatar de cocu3  
Fecha de Ingreso: diciembre-2007
Mensajes: 235
Antigüedad: 16 años, 4 meses
Puntos: 6
Respuesta: Buscar Fotografia en otra ruta

hola, puedes hacer el desarrollo con un nuevo layout donde te visualice solo las imagenes que quieras,

saludos
__________________
editor de fotos

Etiquetas: java
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:33.