android.app.ContextImpl.startActivity(ContextImpl.java:617)
2011-12-01 21:37
746 查看
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? at android.app.ContextImpl.startActivity(ContextImpl.java:617) 貌似在startActivity之前要加个标记: intent.addFlag(Intent.FLAG_ACTIVITY_NEW_TASK),无论是在activity类中,还是在其它组件类中都需要加这句话, 异常信息中已经说明了,需要FLAG_ACTIVITY_NEW_TASK intent.addFlag(Intent.FLAG_ACTIVITY_NEW_TASK)
相关文章推荐
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- java.lang.RuntimeException: Unable to start activity ComponentInfo....android.os.NetworkOnMainThread
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ex.activity/com.ex.activity.LoginActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- android.util.AndroidRuntimeException Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? com.uethinking.microvideo.manag
- android中使用fragment时出现如下错误 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fra
- android4.0 编译错误-----AccelerometerPlayActivity.java:19: 无法访问 android.app.Activity
- Android中Activity全局共享方法AppContext
- android.util.AndroidRuntimeException: Calling startActivity from outside of an Activity context
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android ContextThemeWrapper cannot be cast to android.app.Activity
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误的集中原因及解决办法
- android启动Dialog风格Activity报错:java.lang.IllegalStateException: You need to use a theme.appcompat theme
- android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context re
- Android--context.startActivity(i…
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPoi
- Android开发中java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}
- Android Studio java.lang.RuntimeException: Unable to start activity ComponentInfo
- Android开发中 java.lang.RuntimeException: Unable to start activity XXXXXX java.lang.NullPointerExceptio