onCreate flow continues after finish()

后端 未结 2 452
小鲜肉
小鲜肉 2020-12-03 09:46

I would like to finish an activity from inside the onCreate method. When I call finish(), onDestroy() is not immediately called, the c

2条回答
  •  無奈伤痛
    2020-12-03 10:14

    It seems like finish() does not work until onCreate() return control to system. Please refer to this post: about finish() in android. You have to consider this issue if you don't want any of your code to be executed after calling finish.

    Hope it helps.

提交回复
热议问题