Restart app to a certain activity?

前端 未结 2 1918
清歌不尽
清歌不尽 2021-01-07 14:17

I need to restart my app to a certain activity...is it possible?

When I restart it I don\'t want to start the first activity of application. How can I do this?

2条回答
  •  孤独总比滥情好
    2021-01-07 15:00

    You have to start the Activity you wish straight from the initial Activity's onCreate(). As this is only applicable when the app restarts, you have to save a SharedPreference to flag the fact your app has already started once.

    There won't be any flickering as Activity is designed in a way it is not displayed if another Activity is started during its onCreate().

提交回复
热议问题