android - how to disable the previous activity when click on the next activity -
i having multiple activity in program flow of mainactivity
-loginactivity
-nextloginactivity
etc.,i applying transparency theme on each activity except main activity want when click activity should show mainactivity
in background rather previous activity.
maybe want result below?
you open app, app these activity in order: mainactivity -> loginactivity -> otheractivity
and want click button
in otheractivity
, don't want return loginactivity
mainactivity
if is, can this:
button.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent intent = new intent(this, mainactivity.class); intent.setflags(intent.flag_activity_clear_top); startactivity(intent); } });
in line: intent.setflags(intent.flag_activity_clear_top);
activity use launch mode
singletask
.
if activity stack has mainactivity, finish other activity on top of mainactivity, return mainactivity.
Comments
Post a Comment