又尝试了对整个onReceive方法了个同步,会报receiver对象不能锁定: public class MyReceiver extends BroadcastReceiver { @Override synchronized public void onReceive(Context context,final Intent intent) { String action = intent.getAction(); 错误信息是:java.lang.IllegalMonitorStateException,Receiver not locked by thread before wait()
2.接受广播的activity的在manifest中<intent-filter>的设置是否正确
@Override
synchronized public void onReceive(Context context,final Intent intent) {
String action = intent.getAction();
错误信息是:java.lang.IllegalMonitorStateException,Receiver not locked by thread before wait()