Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app crash when progress dialog is on progress and app's orientation changed. why?

Tags:

android

I have an application in which a progress dialog is shown. The progress dialog is working properly on any one orientation. But when I change the orientation during the progress dialog is on progress mode, then the app crashes.

So, now how can i fix this problem?


Update

Hello, Thanks for your answer. Here I have extracted the progress dialog code from the whole project and there is no problem. You have said to see the Log cat file. But I do not understand the Logcat file. Actually what type of error message will be on the Logcat file if the Activity.onCreate() function will create any problem?

If you have any senario please help me.

Best Regards, gsmaker

like image 299
gsmaker Avatar asked Aug 19 '10 06:08

gsmaker


2 Answers

Most chances, this is not the ProgressDialog fault. Take into an account that Activity.onCreate() is called on every orientation change. In any case, look at LogCat output, you will get more information about the FC.

like image 143
UrK Avatar answered Oct 15 '22 11:10

UrK


in your AndroidManifest.xml, add in the used activity this:

android:screenOrientation="nosensor" android:configChanges="keyboardHidden|orientation"

like image 27
Elvis Avatar answered Oct 15 '22 12:10

Elvis