title: try to save in internal bitmap picture
body: <p>the app is when the member click the btn camera is open and take pic and the see it in the image view. and when he close the app the picture need to save in the internal storage. 
  the problem is when i click in the btn and click V after i take photo the app is crash/</p>
  
  <pre><code>package com.e.test;
  
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.provider.MediaStore;
  import android.support.annotation.Nullable;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ImageView;
  
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  
  public class MainActivity extends AppCompatActivity {
  </code></pre>
  
  <p>global variables:</p>
  
  <pre><code>    final int CAMERA_REQUEST = 1;
      ImageView imageview;
      Bitmap bitmap;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  </code></pre>
  
  <p>this is the load image:</p>
  
  <pre><code>        try {
              FileInputStream fis = openFileInput("pictures");
              bitmap = BitmapFactory.decodeStream(fis);
              imageview.setImageBitmap(bitmap);
              fis.close();
  
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          Button btn = findViewById(R.id.btn);
          imageview = findViewById(R.id.image_result);
  
          btn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                  startActivityForResult(intent,CAMERA_REQUEST);
  
              }
          });
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          if(requestCode == CAMERA_REQUEST &amp;&amp; resultCode == RESULT_OK)
          {
              bitmap = (Bitmap)data.getExtras().get("data");
              imageview.setImageBitmap(bitmap);
          }
      }
  </code></pre>
  
  <p>this is the save:</p>
  
  <pre><code>    @Override
      protected void onPause() {
          super.onPause();
          try {
              FileOutputStream fos = openFileOutput("pictures",MODE_PRIVATE);
              bitmap.compress(Bitmap.CompressFormat.JPEG,50,fos);
              fos.close();
  
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  }
  </code></pre>