android静态注册广播(BroadCastReceiver)时,在onReceive中使用Intent及相关方法,处先如下错误提示:
java.lang.RuntimeException: Unable to start receiver “xxxx”:android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
解决方式:根据提示,onReceive 中需要FLAG_ACTIVITY_NEW_TASK 标识;
如下:
|