android - Handling SMS BroadcastReceiver into Another Acitivity -
i have inbox class extends activitygroup implements onitemclicklistener. inbox class has menuitem name get, when called have method name getsms();
now have class:
public class inboxsmsreciever extends broadcastreceiver{ list<string> inboxemails; @override public void onreceive(context context, intent intent) { inboxemails = new arraylist<string>();; inboxemails = getsmsasemails(intent); } private list<string> getsmsasemails(intent intent){ list<string> inboxemails = new arraylist<string>(); bundle bundle = intent.getextras(); smsmessage[] smsmessage=null; if(bundle !=null){ object[] pdus = (object[]) bundle.get("pdus"); smsmessage = new smsmessage[pdus.length]; for(int i=0;i<smsmessage.length;i++){ smsmessage[i]=smsmessage.createfrompdu((byte[])pdus[i]); inboxemails.add(smsmessage[i].getmessagebody()); } } return inboxemails; }}
how return smsrecieved inbox class getsms() method.
suggestions please
Comments
Post a Comment