Foros del Web » Programación para mayores de 30 ;) » Java »

Buscar Fotografia en otra ruta

Estas en el tema de Buscar Fotografia en otra ruta en el foro de Java 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 06/11/2015, 16:04
Avatar de joseanguiano  
Fecha de Ingreso: agosto-2015
Ubicación: Coatzacoalcos
Mensajes: 87
Antigüedad: 8 años, 8 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
__________________
Lo fácil, ya lo hice, lo difícil lo estoy haciendo y lo imposible, me tardare pero lo lograre.
  #2 (permalink)  
Antiguo 07/11/2015, 02:12
Avatar de Profesor_Falken  
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 8 meses
Puntos: 182
Respuesta: Buscar Fotografia en otra ruta

Buenas

Puede que alguien sepa contestarte aqui, pero creo que es mejor que plantees tu cuestion en el subforo de Android:
http://www.forosdelweb.com/f165/

Un saludo
__________________
If to err is human, then programmers are the most human of us

Etiquetas: android
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 08:56.