android - Waze-like notification icon that returns to app -
i'm trying add notification icon application, function waze's notification icon - when open status bar , tap on "return myapp" line, application move foreground - same activity stack state had when moved background.
i went on numerous questions, , found lot of answers if know in advance activity going shown when notification tapped. don't know activity it's going - can of app's activities.
i tried sending broadcast when notification tapped. can broadcast in receiver alright, there i'm stuck exact same problem - don't know activity launch - can't find last activity (i can find last task, since app has 1 task, it's no help).
you need create pending intent.
like this:
intent notifyintent = new intent(context, chat.class);
pendingintent intent = pendingintent.getactivity(chat.this, 0, notifyintent, simple_notfication_id); notifydetails.setlatesteventinfo(context, contenttitle, contenttext, intent); notifyintent.setflags(intent.flag_activity_clear_top | intent.flag_activity_single_top); mnotificationmanager.notify(simple_notfication_id, notifydetails);
please see link
Comments
Post a Comment