相关疑难解决方法(0)

Activity.finish()如何在Android中运行?

有人可以提供一个Activity调用其finish()方法时会发生什么的描述吗?

它会立即退出,还是完成调用它的函数?

java android

103
推荐指数
3
解决办法
6万
查看次数

finish not stoping the activity code execution

I tried the following code

Log.d("t20", "First here");
startActivity(new Intent(this, AnotherActivity.class));     
finish();
Log.d("t20", "Then Here");
Run Code Online (Sandbox Code Playgroud)

log output:

First here
Then Here
Run Code Online (Sandbox Code Playgroud)

Why the second log message is printed? The execution should be stopped at finsh(), right?

android activity-finish

4
推荐指数
1
解决办法
1576
查看次数

标签 统计

android ×2

activity-finish ×1

java ×1