android - Only one instance of entire app multiple activities -
i have android app 3 activities. want have 1 instance encompasses 3 activities.
so activities a, b, , c, want user able looking @ 1 of @ time. not want multiple instances of of these activities. have tried android:launchmode="singletask"
sort of works in way, when user returns app, launches activity again first instead of going activity b, user pressed home button.
would best me moved fragments hosted these activities 1 activity , away activities b , c? activity hosts 1 fragment, login/signup page.
using singletask launch mode
need still add intent
flags when starting other activities?
so activities a, b, , c, want user able looking @ 1 of @ time.
you can have 1 activity
on focus @ time. activity
might visible behind activity
(i.e. top activity
might themed dialog
), 1 activity
has focus; hence user can interact 1 activity
@ time.
it launches activity again first instead of going activity b
android launch first activity
labeled as
<intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter>
in androidmanifest.xml. can add logic create illusion activity
not called, , launch intent
corresponding one.
would best me moved fragments hosted these activities 1 activity , away activities b , c?
that entirely you. in opinion, might feel more proper use fragments
since can replace them based on logical conditions (i.e. logged in or not) without having create new activity
(it might seem more seamless user).
Comments
Post a Comment