How to finish current activity in Android

前端 未结 8 1413
长发绾君心
长发绾君心 2020-11-28 03:19

I have an Android application. I am making a loading screen with a progress bar.

I entered a delay in the onCreate method. When the timer finishes, I want to finis

8条回答
  •  孤城傲影
    2020-11-28 03:25

    What I was doing was starting a new activity and then closing the current activity. So, remember this simple rule:

    finish()
    startActivity<...>()
    

    and not

    startActivity<...>()
    finish()
    

提交回复
热议问题