安卓常见异常处理

1.crashDump:{java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

at android.support.v4.app.l.s(FragmentManager.java:1314)

处理方法:

FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.replace(R.id.content, mChatFragment, "home");
        if(isFinishing()) {
            return;
        } else {
            ft.commitAllowingStateLoss();
        }

2.No Activity found to handle Intent { act=android.media.action.IMAGE_CAPTURE (has extras) }

处理方法: 
PackageManager packageManager = context.getPackageManager();
if (packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {

你可能感兴趣的:(安卓常见异常处理)