如何以编程方式阻止短信?

问题描述:

abortBroadcast()无效。

代码如下:

abortBroadcast() doesn''t work.
The code is as follows:

<br />
<pre lang="cs">public class SMSReceiver1 extends BroadcastReceiver<br />
{<br />
    @Override<br />
    public void onReceive(Context context, Intent intent)<br />
    <br />
         this.abortBroadcast();<br />
		Toast tag = Toast.makeText(context, "Abort Broadcast!!!", Toast.LENGTH_LONG);<br />
		tag.setDuration(30);<br />
		tag.show();<br />
</pre><br />





我的目的是阻止传入的短信信息。但是在中止功能之后,当我使用Toast时,仍会向用户显示传入消息。





My intention is to block incoming sms message. But after abort function, incoming message is still shown to user as I used a Toast.

Toast.makeText(context, str, Toast.LENGTH_SHORT).show();





我该怎么办?

请尽快回复我。

美好的一天。



How do I do?
Please, reply me ASAP.
Have a nice day you all.

我不知道如何在收到短信之前阻止它。



但是,可以通过使用SMS收件箱中的查询来接收通过Android阅读短信。适用于Android的SMSPopUp应用程序可以做到这一点以及更多。此应用程序的源代码可在此处找到 https://code.google.com/p/android-smspopup/



例如,查看SMSPopUp应用程序中的getSmsDetails方法。
I don''t know how you can block an sms message before it is received.

However, reading a SMS via Android can be done after it is received can be done using a query on the SMS inbox. The SMSPopUp application for Android does this and more. The sourcecode of this application can be found here https://code.google.com/p/android-smspopup/

For example, look at the getSmsDetails method in the SMSPopUp application.