2014-03-12 2 views
1

그 :안드로이드 - 웹 링크에 클릭 한 후 다른 응용 프로그램 내 응용 프로그램을 실행 내가 설명해 드리죠 당신이 바로 내 질문을 얻을 수 있는지 알고, 그렇게하지 않는 다른 앱

내 애플은 선택기에 표시되어 사용자가 클릭 한 후 웹 링크를 클릭 한 다음 사용자가 내 앱을 클릭하면 앱에 webview의 링크가 표시됩니다. 이것은 잘 작동합니다.

하지만 문제는 사용자가 홈 스크린이나 앱 서랍에있는 아이콘을 클릭하여 다른 앱을 다시 시작한 경우 (내 앱을 먼저 호출 한 경우), 원래 앱 대신 내 앱을 다시 엽니 다. .

매니페스트 :

<activity 
    android:name="com.droidfox.app.browser" 
    android:label="@string/browser" 
    android:theme="@android:style/Theme.Black.NoTitleBar" 
    android:launchMode="singleTop" 
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize" > 
    <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
    </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" /> 
     <data android:scheme="https" /> 
    </intent-filter> 
</activity> 

돌아 가기 버튼 재정의 :

@Override 
public void onBackPressed() 
{ 
    moveTaskToBack(true); 
} 

다른 응용 프로그램 내 응용 프로그램을 실행하고 나는이 문제를 어떻게 해결할 수있는 사람이 왜 단서가 있습니까?

+0

당신은 웹 브라우저를 실행하고 있습니까? 그렇지 않으면; 스키마로 http 및 https 이외의 다른 것을 사용하십시오. 또는 모든 유형의 HTTP 요청을 시작하지 않도록 최소한 호스트를 지정하십시오. – mach

+2

'android : noHistory'를 액티비티 매니페스트에 넣으십시오. – gunar

+0

@gunar : Jup, 그게 다야! 너와 나를 도우 려했던 모든 사람들에게 감사한다. 이 질문에 답을 달아 주시면 정답으로 표시하겠습니다. – DroidFox

답변

2

주어진 활동에 맞게 android:noHistory (으)로 설정하십시오.
documentation에서 촬영 :

Whether or not the activity should be removed from the activity stack and finished (its finish() method called) when the user navigates away from it and it's no longer visible on screen — "true" if it should be finished, and "false" if not. The default value is "false". A value of "true" means that the activity will not leave a historical trace. It will not remain in the activity stack for the task, so the user will not be able to return to it.