對不起,如果它已經回答,我搜索,並找不到(可能是我的關鍵詞是錯誤的),因爲我找到解釋如何強制退出應用程序,或退出所有活動,...但它是不是我的問題。我的應用程序退出。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