views:

377

answers:

1

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 ???

+2  A: 

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);
}
Cytown
Why do you need to override `onConfigurationChanged` if you do nothing different in your code?
Mirko Nasato
will you explain the code above ?
Faisal khan
It works though i didn't over the java method only added the xml change.you are genius
Faisal khan