Código HTML:
/images/fotouno.jpg
Código Java:
Ver original
public class EnviarFotoEntrada extends Activity { private ShareActionProvider myShareActionProvider; EditText edittextEmailAddress; EditText edittextEmailSubject; EditText edittextEmailText; TextView textImagePath; Button buttonSelectImage; final int RQS_LOADIMAGE = 0; Uri imageUri = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.enviar_foto_entrada); edittextEmailAddress = (EditText) findViewById(R.id.email_address); edittextEmailSubject = (EditText) findViewById(R.id.email_subject); edittextEmailText = (EditText) findViewById(R.id.email_textx); edittextEmailAddress.addTextChangedListener(commonTextWatcher); edittextEmailSubject.addTextChangedListener(commonTextWatcher); edittextEmailText.addTextChangedListener(commonTextWatcher); textImagePath = (TextView) findViewById(R.id.imagepath); buttonSelectImage.setOnClickListener(buttonSelectImageOnClickListener); Toast.makeText( getApplicationContext(), "¡Selecciona tu imagen, y enviala al correo electronico proporcionado por el administrador!", Toast.LENGTH_LONG).show(); } TextWatcher commonTextWatcher = new TextWatcher() { @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub setShareIntent(createShareIntent()); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } }; OnClickListener buttonSelectImageOnClickListener = new OnClickListener() { @Override Intent intent = new Intent( Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent, RQS_LOADIMAGE); } }; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { switch (requestCode) { case RQS_LOADIMAGE: imageUri = data.getData(); textImagePath.setText(imageUri.toString()); setShareIntent(createShareIntent()); break; } } } @Override getMenuInflater().inflate(R.menu.enviar_foto_entrada, menu); myShareActionProvider = (ShareActionProvider) item.getActionProvider(); myShareActionProvider .setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME); myShareActionProvider.setShareIntent(createShareIntent()); return true; } private Intent createShareIntent() { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_EMAIL, emailAddressList); shareIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject); shareIntent.putExtra(Intent.EXTRA_TEXT, emailText); if (imageUri != null) { shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri); shareIntent.setType("image/png"); } else { shareIntent.setType("plain/text"); } return shareIntent; } private void setShareIntent(Intent shareIntent) { if (myShareActionProvider != null) { myShareActionProvider.setShareIntent(shareIntent); } } Intent salircom = new Intent(this, Home.class); startActivity(salircom); } }
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