java - How do I clear the back history of my app only if user performs an action? -


i having trouble controlling behaviour of intent.

the use case this: when user browsing internet in chrome , clicks on menu, share , on app, screen opens allowing user edit information. when user done editing or can click on "done, choose chat post". new activity opens available chats.

at point, user should able press standard button return editing activity or user can click on chat post.

if user clicks on chat , posts link, new acitivity starts chat allowing user continue chatting or press return browser , not "choose chat" activity or "edit information" activity.

so want able following:

use case 1: [browser] --> [share] --> [edit info] --> [choose chat]. (back button returns [edit info].

use case 2: [browser] --> [share] --> [edit info] --> [choose chat] --> [open chat] . (back button return [browser].

i have tried various combinations of intent flags when starting [edit info] , [choose chat] none giving me behaviour trying achieve.

so question is: how clear history of app only, allowing user return previous app when user finishes prescribed process (in case, posting link in chat)?

on creating activity open chat, use flag

intent = new intent(); i.setclass(getactivity().getapplicationcontext(), youractivity.class); i.addflags(intent.flag_activity_new_task | intent.flag_activity_clear_task); startactivity(i); 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -