活动周期的问题 [英] Activity lifecycle issues
本文介绍了活动周期的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有3个活动运行,导航A1到此时A2 A2到a3.Now pressing后退按钮从模拟器,我想去活动A1没有完成的活动我a2.How可以做this..Please指南提前me..Thanks
I have 3 activities running ,navigating a1 to a2 then a2 to a3.Now pressing back button from emulator,I want to go to the activity a1 without finishing activity a2.How can i do this..Please guide me..Thanks in advance
推荐答案
是的,你可以覆盖后退按钮
Yes you can override that back button
public void onBackPressed() {
Intent start = new Intent(currentclassname.this,which activity u want.class);
startActivity(start);
finishActivity(0);
}
通过这个你可以在任何活动而移动。这是非常容易和简单的方式
By this you can move on any activity. This is very easy and simple way
这篇关于活动周期的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文