android - Application crashes after notification -
*notification working fine problem crashed after clicking button *it says add @ add@suppresswarnings 'deprication' n , add @ add@suppresswarnings 'deprication' onclick
public class testinput extends activity { button setbutton; location location, locationa, locationb; locationmanager locationmanager; notificationmanager nm; public static final int uniqueid =1; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.showcoords); nm = (notificationmanager) getsystemservice(context.notification_service); nm.cancel(uniqueid); setbutton = (button) findviewbyid(r.id.btnshowlocation); setbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent intent = new intent(testinput.this, goin.class); pendingintent pi = pendingintent.getactivity(getbasecontext(), 0, intent, 0); string body = "this notification"; string title = "test"; notification n = new notification(r.drawable.route, body, system.currenttimemillis()); n.setlatesteventinfo(testinput.this, title, body, pi); n.defaults = notification.default_all; nm.notify(uniqueid, n); finish(); } }); } }
Comments
Post a Comment