android - Opening an activity from Notification with PendingIntent after the App has been killed causing App to crash -
i need open activity
clicking on notification
(with pendingintent
) after application has been killed. how setting pendingintent
.
var chatactivityintent = new intent (this, typeof(chatactivity)); chatactivityintent.putextra ("uuid", channelviewmodel.uuid); chatactivityintent.putextra ("channelsviewmodel", jsonconvert.serializeobject(channelviewmodel.channellist [0]) ); chatactivityintent.addflags (activityflags.cleartop | activityflags.singletop | activityflags.newtask); var pendingintent = pendingintent.getactivity (this, 0, chatactivityintent, 0); notification.setlatesteventinfo (this, chatviewmodel.schoolname, chatviewmodel.message, pendingintent);
this works gracefully when app active or in background. chatactivity
opens when click notification.
but after app killed, when click on notification has arrived, error message unfortunately, app has stopped.
Comments
Post a Comment