对不起,如果它已经回答,我搜索,并找不到(可能是我的关键词是错误的),因为我找到解释如何强制退出应用程序,或退出所有活动,...但它是不是我的问题。我的应用程序退出。Android问题,而退出我的应用程序
我有一个奇怪的问题,而我退出我的应用程序。 步骤重现我的问题(而且是每一个我做以下步骤时间):
我启动应用程序X,通过例如游戏,Android的参数,这个“Hello World”默认的应用程序。 ..
我按下HOME键
现在我启动(从应用程序的列表)我的应用程序
我按回到退出我的应用程序
我的应用程序退出
中启动的应用程序(1)自动启动,而不是 返回首页
的信息:我退出我的拍摄返回键的应用程序,如果真的问用户要退出,如果他说是的,我叫finish()
--edit 1 start-- 我可以分享一些代码,完成方法(内部活动):
private void reallyExitTheApplication()
{
if(this.serviceLink!=null)
{
this.unbind(this.serviceConnection);
this.serviceLink = null;
}
this.finish();
}
和代码调用它
public void onClick(View view)
{
switch(view.getId())
{
// ...
case R.id.buttonValidateExit :
this.reallyExitTheApplication();
break;
// ...
}
}
--edit 1 end--
- 编辑2开始 -
我还添加了清单部分对我的活动:
<activity
android:name="jhelp.tests.browser.BrowserManagerActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
android:label="@string/browserName"
android:launchMode="singleInstance"
android:taskAffinity="jhelp.tests.browser">
<intent-filter>
<action
android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="org.mozilla.gecko.LOAD"/>
</intent-filter>
<intent-filter>
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http"/>
</intent-filter>
<intent-filter>
<action
android:name="android.intent.action.VIEW"/>
<category
android:name="android.intent.category.DEFAULT"/>
<category
android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
</intent-filter>
</activity>
- 编辑2结束 -
任何想法为什么Android决定启动应用程序(1)而不是返回到家?
我以前建了很多应用程序,第一次看到这个。
感谢所有帮助
JHelp
分享你的代码 – AndroidMechanic
我可以分享你的退出功能: – JHelp
是的,将它添加到你的问题 – AndroidMechanic