java - Creating a login type of activity and forcing it the only opening point -
i have been doing research, feel if missing something.
i have app login. each time open app, should forced through login page. should never able resume onto activity other login.
in manifest have
android:cleartaskonlaunch="true"
on main activity wish use login activity,
and
android:finishontasklaunch="true"
as
android:excludefromrecents="true"
on rest of activities.
the problamatic situation occurs when go login activity, hit home, , relaunch app via icon. should jump login page, doesnt. idea?
i have been installing regular apk, not via eclipse know there issue eclipse , of manifest attributes.
perhaps if there way detect activity launch came app icon press, manage way, dont think possible either.
in either onresume
or onrestart
check series of flags, such login timeout, force user login activity using intent
, while @ same time finishing original activity.
i method in favor or finishing app in either onpause
or onstop
because gives chance make checks before blindly closing application.
or, try using android:nohistory
tag in manifest file.
a value of "true" means activity not leave historical trace. not remain in activity stack task, user not able return it.
there other tags such as, android:finishontasklaunch
whether or not existing instance of activity should shut down (finished) whenever user again launches task (chooses task on home screen) — "true" if should shut down, , "false" if not. default value "false".
more information here: http://developer.android.com/guide/topics/manifest/activity-element.html
Comments
Post a Comment