I’m new to android development and I’ve developed a small app but I’m facing problems with linking different activities (i.e navigating between activities in a desired way).
I am sorry to ask these questions but I tried different solutions from google but none of them worked for me and I’m still not clear with these concepts.
Plz help
I have some questions:
-
How to delete activity at top of stack?
-
How to delete all activities from activity stack?
-
Intent(A.this,B.class) with (Intent.FLAG_ACTIVITY_NO_HISTORY) will not add activity B to stack but what if I want to add activity A to stack?
-
Is there a way by which I can visualize contents of activity stack (that will help me to set appropriate flags while calling activities)?
-
I have an activity A (with 3 buttons) from which I call activity B where I get some operations done with user input and I want to come back to activity A but I want to show only 1 button out of those 3 how can I do this?
(Problem I’m facing is the activity in A has 3 buttons so I want to relaunch it either by deleting it and making new intent OR making the same entry in stack to start again so that depending on conditions it will display 1 button)
Thanks in advance.
Answer for last qn:
Use startActivityForResult to start the Activity B and override onActivityForResult in Activity A. onActivityResult will be called When the Activity B is finished/exited.
You can set the visibility of the Buttons to GONE/INVISIBLE inside the onActivityResult.