开发者

Android Screen orientation, shake cellphone crashes the application

I am having search application, which loads d开发者_运维知识库ata 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 ???


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);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜