- 这里是一个内部类定义广播接受器,出现错误
has no zero argument constructor
,将接收器类定义为public static
- 可能也有
java.lang.IllegalAccessException
错误,构造函数public - 之后在static接受器中可能无法调用非静态staticActivity()函数,可以使用接收器的context.startActivity()
之后会有错误,
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
此时设置intent的flag属性,
it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Android-广播 BroadcastReceiver-java.lang.IllegalAccessException: access to constructor not allowe
最新推荐文章于 2023-10-21 12:39:06 发布