android - Register Broadcast receiver in button click -


the receiver not getting registered when button clicked. doing wrong?

private void  appsatartconfirmationdialog() {     alertdialog.builder bi=new alertdialog.builder(this);     bi.settitle(r.string.dialoga_pp_sart_conf_title);     bi.setmessage(r.string.dialog_app_sart_conf_message);     bi.setpositivebutton(r.string.dialog_app_sart_conf_ok, new dialoginterface.onclicklistener() {         @override         public void onclick(dialoginterface dialog, int which) {             // todo auto-generated method stub             //caling receiver             intentfilter intentfilter = new intentfilter("intent.action.phone_state");             registerreceiver(mreceiver, intentfilter);              toast.maketext(mainactivity.this,             r.string.dialog_app_start_toast,             toast.length_short).show();         }     }); 


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -