Mustafa Kemal
Lurker
I can get sms from the phone I want to delete the last message from the phone. How can i do that? Can u help me? Thanks.
The code I use to for pull SMS:
The code I use to for pull SMS:
Code:
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
SmsMessage[] smsm = null;
String sms_str = "";
String id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
if (bundle != null) {
Object[] pdus = (Object[]) bundle.get("pdus");
smsm = new SmsMessage[pdus.length];
for (int i = 0; i < smsm.length; i++) {
smsm[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
sms_str += "SMS: ";
sms_str += smsm[i].getMessageBody().toString();
sms_str += "\n\r";
String number= smsm[i].getOriginatingAddress();
Intent smsIntent = new Intent("otp");
smsIntent.putExtra("message", sms_str);
LocalBroadcastManager.getInstance(context).sendBroadcast(smsIntent);
}
}