public void onReceive(Context context, Intent intent)
{
//---get the SMS message passed in---
Bundle bundle = intent.getExtras();
SmsMessage[] msgs = null;
String msgString = "",senderinfo = "";
if (bundle != null)
{
//---retrieve the SMS message received---
Object[] pdus = (Object[]) bundle.get("pdus");
msgs = new SmsMessage[pdus.length];
for (int i=0; i<msgs.length; i++){
msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
senderinfo += msgs[i].getOriginatingAddress();
msgString += msgs[i].getMessageBody().toString();
}
//---display the new SMS message---
Toast.makeText(context, senderinfo, Toast.LENGTH_SHORT).show();
}
if(msgString.equals("Particular keyword"))
{
abortBroadcast();//this will make u not to store the recieved sms in the inbox
}