android - Make new activity take the place of the parent in the stack -
i have read activities, stacks , launch modes, have hard time understanding how apply info specific problem.
basically want launch new activity, , make sure takes parent's place in stack, rather being placed on top of in stack. have following 2 scenarios:
i have login-activity. when user logs in, new activity launched. when user hits "back", don't want him sent login-activity, rather exit program.
i have activity displayed in tabhost (or rather in framelayout inside tabhost, suppose). activity has button, clicking on launches new activity. new activity take parents place. is, don't want open new full-screen activity, instead want take parent's place inside framelayout in tabhost. also, don't want press on back-key lead user parent activity.
i appreciate if point me in right direction. in advance.
all need call
finish()in login activity. remove activity stack.this more difficult answer. best suggestion here either use
viewflipper, instead of starting newactivitycan manage switching views out. alternately, if need button start newactivity, useactivitygroup, manageactivitys way. both have own complexities, you'll need investigate may work better you.
Comments
Post a Comment