Note that there are some explanatory texts on larger screens.

plurals
  1. POTaking a picture and then emailing it
    primarykey
    data
    text
    <p>I am trying to create an application where you can take a picture and then email it to someone. At the moment I can take a picture and set my background as this picture:</p> <pre><code>public class Camera extends Activity implements View.OnClickListener{ ImageButton ib; Button b; ImageView iv; Intent i; final static int cameraData = 0; Bitmap bmp; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.photo); initialize(); InputStream is = getResources().openRawResource(R.drawable.ic_launcher); bmp = BitmapFactory.decodeStream(is); } private void initialize(){ ib = (ImageButton) findViewById(R.id.ibTakePic); b = (Button) findViewById(R.id.bSetWall); iv = (ImageView) findViewById(R.id.ivReturnedPic); b.setOnClickListener(this); ib.setOnClickListener(this); } @Override public void onClick(View v) { File mImageFile; // TODO Auto-generated method stub switch(v.getId()){ case R.id.bSetWall: try { getApplicationContext().setWallpaper(bmp); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } break; case R.id.ibTakePic: i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(i, cameraData); break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); if(resultCode == RESULT_OK){ Bundle extras = data.getExtras(); bmp = (Bitmap)extras.get("data"); iv.setImageBitmap(bmp); } } } </code></pre> <p>I have a separate application where I can take in user input and email it to a predefined address:</p> <pre><code> public void onClick(View v) { // TODO Auto-generated method stub convertEditTextVarsIntoStringsAndYesThisIsAMethodWeCreated(); String emailaddress[] = { "info@sklep.com", "", }; String message = emailAdd + name + beginning; Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emailaddress); emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, message); startActivity(emailIntent); } </code></pre> <p>How do I go about emailing the picture that I have taken? Where is it saved and how do I access it so that I can email it?</p> <p>Many Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload