以编程方式禁用新彩信的系统通知?
abortBroadcast()
用于禁用新短信的系统通知,但是是否可以对新彩信执行此操作?我尝试过使用 abortBroadcast()
但它似乎不起作用。任何帮助将不胜感激,谢谢。
编辑: 我尝试使用以下代码,以便我的应用程序首先捕获意图,但它会阻止彩信进入我的收件箱。
<application android:icon="@drawable/icon" android:label="@string/app_name">
<receiver android:name=".MMSReceiver" android:enabled="true">
<intent-filter android:priority="100">
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
更具体地说,有没有办法检测新彩信的系统通知并以编程方式抑制它们?
abortBroadcast()
is used for disabling system notification for new SMS messages, but is there anyway to do it for new MMS messages? I've tried using abortBroadcast()
but it doesn't seem to work. Any help would be appreciated, thanks.
Edit:
I have tried using the following codes so that my application will catches the intent first, but it prevents the MMS message from entering my inbox.
<application android:icon="@drawable/icon" android:label="@string/app_name">
<receiver android:name=".MMSReceiver" android:enabled="true">
<intent-filter android:priority="100">
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
</receiver>
To be more specific, is there any way to detect system notifications for new MMS messages and suppress them programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
注意:在您的清单文件中添加 BroadcastReceiver -
添加此权限:
try this:
Note: In your manifest file add the BroadcastReceiver -
Add this permission: