3

I am having search application, which loads data retreived from the webservice.

While application on create it shows progress dialog once its done with loading data it dismiss the progress dialog.

problem is while loading if i change the orientation of the phone it works fine it try to load activity again, but if i start shaking the cellphone while it is loading data application get crashed, any solution ???

1
  • How can i force activity to do not change its orientation until it gets loaded completely ?
    – d-man
    Jan 15, 2010 at 13:23

1 Answer 1

3

put

android:configChanges="keyboardHidden|orientation"

in you Activity xml tags.

and add these code to your activity.java

@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
}
3
  • Why do you need to override onConfigurationChanged if you do nothing different in your code?
    – Mirko N.
    Jan 15, 2010 at 17:05
  • It works though i didn't over the java method only added the xml change. you are genius
    – d-man
    Jan 17, 2010 at 9:25
  • Just a note that this is an easy way out, and a rotation change isn't the only configuration change one will encounter. You should design your Activities and Asynctasks to be decoupled from each other so that the Asynctask doesn't have a bad Context
    – SeanPONeil
    Jan 10, 2012 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.