I’m using the camera intent to take a picture and process the pixels.
This works good so far, but when I press the Backbutton to reinitialize the camera a second time the app crashes.
My app also closes when I start it and press back without taking a picture before.
I implemented a button that calls the intent and it has been no problem to take multiple pictures.
LogCat Log didn’t show anything interesting. I guess this is something basic I missed so I don’t post any code but my Onback method.
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
openCamera();
}
EDIT
removing
super.onBackPressed();
solved the closing problem…
Change to
Because default behavour of backButton it’s call finish() for Activity. And you CALL it then invoke super.onBackPressed()
Other words you call default back button, but you want to ovveride it and in code wich must ovveride default action first line you call DEFAULT back button action.