android - How to show a dialog when notification is clicked, while the app being closed -


i want implement feature in to-do apps, when click on notification, shows dialog create to-do instantly, not opening app.

if understood correctly question, need show dialog , not launch application. if yes, can open/launch activity dialog using:

<activity android:theme="@android:style/theme.dialog" /> 

you can have pending intent , set it:

intent intent = new intent(getapplicationcontext(), dialogactivity.class); pendingintent dialogpendingintent =  pendingintent.getactivity(getapplicationcontext(),request_id, intent, pendingintent.flag_update_current);   notfication.setcontentintent(pendingintent); 

please make sure dialogacitivity not extends appcompatacivity, if need provide backward support, use "theme.appcompat.dialog" style.

hope helps!


Comments

Popular posts from this blog

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

javascript - Understanding ExtJS Framework Syntax -