Application crashes on rotation without stackTrace

陌路散爱 提交于 2019-12-04 08:17:28

I'm not sure if this answers the problem of the original poster, but I had this same problem when I had an onPause() method in my main Activity that looked like this:

@Override
public void onPause() {
    super.onResume();

    ...do other stuff...
}

As you can see, it was just a typo, but it took me a while to track it down since the error message "No Activity" was so vague. ("super.onResume" should have been "super.onPause", if it's not obvious.)

If this is not your exact issue, I believe it had something to do with the original Fragment not getting destroyed (by the proper onPause() call in my case).

I found the problem: the android.support.v4.app package was the issue. I replaced all the imports with standard Fragment imports from android.app package.

Using this package my compatibility towards Android 2.0 branch is now broken, but in my case it's not a problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!