I have my app so I have the ability to open the camera and take a picture, the app then shows me a preview of the photo just taken, and when I press 'OK', it is gone. I want to be able to save the image I have taken to my internal storage on my phone, (and possibly have a function so I can access my gallery and preview it later on). I have searched everywhere but all the help I am getting is to store it on an SD card, whereas I want to use my phones built in storage. Thank you
My code so far:
Button butCamera;
ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
butCamera = (Button) findViewById(R.id.butCamera);
imageView = (ImageView) findViewById(R.id.imageView);
butCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent (MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 0);
}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
Bitmap bitmap = (Bitmap)data.getExtras().get("data");
imageView.setImageBitmap(bitmap);
}