We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在学习到第5.3章节 5.3.1 发送标准广播时发现书中代码只提供了发送标准广播的代码,没有提供监听代码,书中给出了...省略号,误以为不需要监听就可以了,调试了许久看了这里的源码才知道。
The text was updated successfully, but these errors were encountered:
不是有代码遗漏,是 Android 8.0 之后,对于广播的发送与接收变严格了,需要加入Component参数。
Intent intent = new Intent("com.example.broad"); intent.setComponent(new ComponentName("com.example.broadcasttest","com.example.broadcasttest.MyBroadcastReceiver")); sendBroadcast(intent);
Sorry, something went wrong.
No branches or pull requests
在学习到第5.3章节 5.3.1 发送标准广播时发现书中代码只提供了发送标准广播的代码,没有提供监听代码,书中给出了...省略号,误以为不需要监听就可以了,调试了许久看了这里的源码才知道。
The text was updated successfully, but these errors were encountered: