我尝试转到上一个活动(活动A),但遇到问题。活动B内部命令该得到和我不会回去B:返回上一个活动
答:
if(...)
{
B.staticF();
}
B:
static void staticF()
{
super.onBackPressed();
}
但因为它是静态的情况下,我不能使用超。
当然,我可以叫
Intent i = new Intent(this, B.class);
startActivity(i);
,但我不会救B的对照。
尝试在intent中添加this.youractivityname。 – OnkarDhane 2012-02-10 09:52:40
我更喜欢使用像这样的“全局”状态:http://stackoverflow.com/a/708317/862629 – 2012-02-10 10:03:58