Performing stop of activity that is not resumed:使用AndroidAnnotations的常见注意事项
2017-06-30 20:15
591 查看
AndroidAnnotations在开发中常见错误分析:
在清单文件AndroidManifest.xml中要注册同名的Activity_等组件
在我们代码中定义的各种控件不能用private修饰符
我们代码中带@注解的方法也不能用private作用方法的修改符
注解的Activity不要继承AppCompatActivity,会报
,最好继承FragmentActivity及其子类,否则就采用网上的方法如下:
当activity被切到后台时,执行onStop,如果此时系统内存不足或当前应用占用内存较多,会导致后台activity部分memroy被释放,因而当后台activity再次回到前台时,执行onResume会使得部分应用需要的变量等无法找到。
解决方法是将必要的变量信息存储到Bundle中,同时在onResume时加载该信息。
希望当你看到这篇博客的时候,能够帮助到你,如果能够,请在下面点个赞,谢谢!
在清单文件AndroidManifest.xml中要注册同名的Activity_等组件
在我们代码中定义的各种控件不能用private修饰符
我们代码中带@注解的方法也不能用private作用方法的修改符
注解的Activity不要继承AppCompatActivity,会报
Performing stop of activity that is not resumed: {com.uniscope.myfile/com.uniscope.myfile.FileExplorerTabActivity} java.lang.RuntimeException: Performing stop of activity that is not resumed: {com.uniscope.myfile/com.uniscope.myfile.FileExplorerTabActivity} at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3344) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3425) at android.app.ActivityThread.access$1100(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
,最好继承FragmentActivity及其子类,否则就采用网上的方法如下:
当activity被切到后台时,执行onStop,如果此时系统内存不足或当前应用占用内存较多,会导致后台activity部分memroy被释放,因而当后台activity再次回到前台时,执行onResume会使得部分应用需要的变量等无法找到。
解决方法是将必要的变量信息存储到Bundle中,同时在onResume时加载该信息。
希望当你看到这篇博客的时候,能够帮助到你,如果能够,请在下面点个赞,谢谢!
相关文章推荐
- Android 报错Android - Performing stop of activity that is not resumed
- Android 报错Android - Performing stop of activity that is not resumed
- Android 报错Android - Performing stop of activity that is not resumed
- Android 4.4.2 - java.lang.RuntimeException: Performing stop of activity that is not resumed
- Performing stop of activity that is not resumed:
- ActivityThread: Performing stop of activity that is not resumed:
- Performing stop of activity that is not resumed #12
- Performing stop of activity that is not resumed
- Performing stop of activity that is not resumed
- Performing stop of activity that is not resumed
- Performing stop of activity that is not resumed
- Android 报错Android - Performing stop of activity that is not resumed
- Android BaseSavedState 以及 Activity onSaveInstanceState 和 onRestoreInstanceState 方法使用注意事项
- Android使用 startActivityForResult 、 onActivityResult 时的注意事项
- Android使用 startActivityForResult 、 onActivityResult 时的注意事项
- 使用Android手机注意事项
- Android使用Java的第三方jar注意事项
- 使用Tortoise SVN版本控制Android项目in eclipse的注意事项
- Incorrect decrement of the reference count of an object that is not owned at this point by the calle
- [Android学习笔记]使用Android Junit进行测试的注意事项