Android的帮助!我要彻底完成我的活动,activity.finish之后没有进一步的code将执行? [英] Android Help! I want to completely finish my activity, and after activity.finish no further code will execute?
问题描述
Android的帮助!我要彻底完成我的活动,activity.finish之后没有进一步的code将执行?
Android Help! I want to completely finish my activity, and after activity.finish no further code will execute?
例如:
Intent scoringOpponentTeam = new Intent(this,TestActivitySecond.class);
startActivity(scoringOpponentTeam);
this.finish();
Log.i("after Finish Called", "after Finish Called--------"+"after Finish Called");
在上面的例子中,我想没有Log.i()线将被执行。请帮我迫切。
In Above Example, I want that no Log.i() line will execute. Kindly help me urgently.
推荐答案
当您呼叫完成()
,Android将让你的code在特定的块在完成后()
调用execute,这就是为什么出现的日志信息。一个简单的收益
的结束后说明()
呼叫解决方案。
When you are calling finish()
, Android will let your code in the specific block after the finish()
call execute, and that is why the log message appears. A simple return
statement after the finish()
call is the solution.
但是,没有必要为你明确地杀你的活动
由于Android处理这个完全靠自己。
However, there is no need for you to explicity "kill" your Activity
since Android handles this perfectly on its own.
这篇关于Android的帮助!我要彻底完成我的活动,activity.finish之后没有进一步的code将执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!