Basically, I press a button, this opens your default camera application using the camera’s intent. After the picture is taken, it will save the necessary things and redirect them to another activity.
In this exercise, I have AsyncTask that can successfully upload images. So what is my problem, you may ask. My problem is that it recreates my activity and therefore reset my ProgressDialog along with it. (He launches the action, makes aSyncTask, dies before he can finish it, and again creates my activity in order to perform the synthesis again.)
It is not always so. I think he does this because he changes the orientation from the phone from Landscape to Portrait. (I have a Samsung. When I go to the camera, it changes to a landscape, and when I finish it, it returns to the portrait.)
I already did my homework and added these things to my manifest:
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
I made sure to “block” the application in portrait orientation, but I still see the orientation to change my application, and I believe that is why my activity is recreated again.
I planned to add all kinds of checks, but I think that this is the wrong way to handle this situation, because sometimes it does not recreate activity.
The check I'm talking about is to use:
protected void onSaveInstanceState(Bundle outState) {
outState.putString("started", "1");
}
Anyway, can someone help me? I just want it to load activity without its self-destruction.
PS: VM . VM , .
PPS: Samsung, , . , , .