Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android
abortBroadcast() doesn't work.
The code is as follows:
public class SMSReceiver1 extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    
         this.abortBroadcast();
		Toast tag = Toast.makeText(context, "Abort Broadcast!!!", Toast.LENGTH_LONG);
		tag.setDuration(30);
		tag.show();
 
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.
Posted 11-Mar-11 3:54am
Edited 11-Mar-11 4:16am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2
Comments
Nauman Zubair at 17-May-13 0:57am
   
Above link is not working, please provide alternate link if possible,
Patrick Kalkman at 20-May-13 5:50am
   
Done, Thanks for you comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 686
1 OriginalGriff 498
2 Tadit Dash 420
3 sanket saxena 337
4 Zoltán Zörgő 230
0 Sergey Alexandrovich Kryukov 11,800
1 OriginalGriff 7,225
2 Peter Leow 5,009
3 Abhinav S 3,893
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 20 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid