title: How to take picture using Intent and send it by email
body: <p>Any help , Ideas I will be appropriated .
  Hello Guys, sorry am asking so much question these days.
  I designed simple android app that use the camera and show the picture is taken at the layout. Look at the attached pictures.
  <img src="https://i.stack.imgur.com/s3bNg.jpg" alt="enter image description here"></p>
  
  <p>Once I click the "open the Camera " button it will pop up the camera asking the use to press the camera buttom to shot or take picture. What I need here , once the camera opens,  it should  take picture by it self with out use the camera button , Idn if is that possible or not.</p>
  
  <p><img src="https://i.stack.imgur.com/DYLR4.jpg" alt="enter image description here"></p>
  
  <p>The next problem as shown in the picture, it requires user interference to press ok if the user like it .  here in this step I need to take just one picture once is taken should go back to main activity. and store the picture in Image View .
  <img src="https://i.stack.imgur.com/BAwjr.jpg" alt="enter image description here"></p>
  
  <p>the last request or ideas guys how to send this pict to the email interference from the user . 
  here is the Code -----------------------------------</p>
  
  <pre><code>public class MainActivity extends Activity {
      ImageView viewpict;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          viewpict=(ImageView) findViewById(R.id.pict_result);
          Button btn= (Button)findViewById(R.id.camera);
  
          btn.setOnClickListener(new OnClickListener(){
  
              @Override
              public void onClick(View arg0) {
                  Intent intent = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              //  Intent intent = new Intent (getApplicationContext(),MainActivity2.class);
  
                  //startActivity(intent);
                  startActivityForResult(intent,0);
  
              }
  
       });
  
  
      }
  
  protected void onActivityResult( int requestCode, int resultCode,Intent data)
  {
      if (requestCode==0)
      {
          Bitmap theimage = (Bitmap) data.getExtras().get("data");
          viewpict.setImageBitmap(theimage);
      }
  
  }
  
  }
  </code></pre>
  
  <hr>