2016-04-28 108 views
2

我在Store中有一個應用程序,我需要爲它提供一個深層鏈接。Android應用程序的深層鏈接

我的問題是鏈接不能打開應用程序,它只是給我在商店的應用程序的頁面,如果沒有安裝商店的頁面給我的選項安裝,如果安裝了應用程序商店給我打開卸載

我需要的是:如果在沒有經過商店的情況下安裝,自動打開應用程序。

+0

可能是你想要的嗎? http://stackoverflow.com/questions/18937677/how-to-open-a-installed-android-app-with-a-button-click-intent – MilapTank

+0

我有這個問題之前,不得不刪除深層鏈接代碼塊。 –

+0

@凱爾你能解釋一下嗎? – Euphor08

回答

0

我找到了,我不得不將此代碼添加到我的Android清單在我falvors了。

<!-- Accepts URIs that begin with "http://」 --> 
       <data android:scheme="http" 
        android:pathPrefix="/casa" /> 

和終端的commadn是:

$ adb shell am start -W -a android.intent.action.VIEW -d "http://example/casa" com.paperpad.casadelmar 
+0

很酷你沒有添加鏈接在清單中的方式問題 –

+0

是,我有2個清單,第一個是應用程序,第二個是風味。我只將它添加到一個,以便導致問題。 – Euphor08

0

試試這個:希望這有助於

Intent launchIntent=getPackageManager().getLaunchIntentForPackage("yourPackagename"); 
if (launchIntent == null) { 
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(" Playstore your APP link"))); 
    } else { 
      startActivity(launchIntent); 
     } 
+0

謝謝,但我需要一個深度鏈接,而不是一個以編程方式解決 – Euphor08

+0

你把深層鏈接清單哪個頁面必須打開 –