07-18 16:34:05.891: E/AndroidRuntime(18396): FATAL EXCEPTION: main 07-18 16:34:05.891: E/AndroidRuntime(18396): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK fla…
记录学习,网络摘抄 碰到这个异常其实这个上面说的很清楚,加个flag 从一个Activity中要通过intent调出另一个Activity的话,需要使用 FLAG_ACTIVITY_NEW_TASK E/AndroidRuntime( ): FATAL EXCEPTION: main E/AndroidRuntime( ): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activ…
startActivity时报错Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag 原代码如下: Intent intent = new Intent(); intent.setClass(mContext, PhotoView.class); Bundle bundle = new Bundle(); intent.putExtras(bundl…
在Activity中使用startActivity()方法不会有任何限制,因为Activity重载了Context的startActivity()方法.但是如果是在其他地方(如Widget或Service.BroadcastReceiver中)使用startActivity()方法,就会报错: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context req…