How can i switch main activity not in manifest?

Viewed 47

I making android app. I have 3 activites:

first(main) activity which is empty and it's like navigation which ask you to add item.

Second activity which is needed for adding item's details and this activity have accept button which leads you to third activity.

Third activity have all data about item and from now on i want my app to make this activity main (default) activity with saving information about it in device memory.

I decided to make it without database because it should be really simple.

Can you help me with making 3rd acitivity main? Maybe there are some tricks.

1 Answers

not clear what you trying to ask. Like if user reached the 3rd activity, in the future if user open the app the app will automatically navigate them to the 3rd activity?

If that's the case, you could save this information in the shared preference, when the app start, the first activity check this value and navigate to the 3rd activity.

Recommend you use a single activity, use fragments for different pages, and use Navigation component to connect them. https://developer.android.com/guide/navigation/navigation-getting-started

Related