我的应用程序正常运行后,在后台仍然在运行,当我对一些新的活动而移动我使用的代码作为如何关闭我的应用程序被关闭
Intent start=new Intent(current activity.this,new activity.class);
startActivityForResult(start, 0);
finish();
,然后当我不得不搬回到以前的活动我用下面的代码
Intent start = new Intent(current activity.this,earlier activity.class);
startActivity(start);
finishActivity(0);
我想这样活动的堆栈可能很清楚。并点击按钮或手机后退按钮我用下面的代码
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(startMain);
但我的应用程序仍在后台运行。我也使用了android:noHistory="true"
应用程序从背景中被杀害,但消息强烈地关闭了该应用程序。简单finish();
移动到最后一个活动。 我也看到了链接Quitting an application - is that frowned upon?但我新,所以我以前不得到多少。请给我一些建议,我该如何处理这个问题。
有没有要搞乱可恢复的整个概念的原因[任务](http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html)和自动管理应用程序生命周期? – zapl
我有8个活动和控制从一个移动到另一个。没有特别的理由。 – BraveGirl