Ok, so I have looked around a lot for this but I can't seem to find anyone else that's had this problem.
I am making a simple application just to test out working with the camera. Everything works up until I actually press the button to capture the image. When I do, instead of freezing and asking for confirmation that this is the picture I want, the confirmation button come up at the bottom, but the live feed from the camera keeps going.
I am using the most basic way of sending an intent to ask android to take a picture so I don't know why this is happening.
Here is the code:
private static final int IMAGE_CAPTURE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
addCaptureButtonListener();
}
private void addCaptureButtonListener() {
Button capture = (Button) findViewById(R.id.captureButton);
capture.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, IMAGE_CAPTURE);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(resultCode == RESULT_OK) {
if(requestCode == IMAGE_CAPTURE) {
Toast.makeText(this, "Image Successfully Taken", Toast.LENGTH_SHORT).show();
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}