开发者

Android Screen orientation, shake cellphone crashes the application

开发者 https://www.devze.com 2022-12-16 06:44 出处:网络
I am having search application, which loads d开发者_运维知识库ata retreived from the webservice.

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

精彩评论

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