2016-08-12 42 views
-1

我開發了一個ecomerce應用程序。我想開發類似flipkart應用程序的共享功能。在android中共享一個鏈接

我在flipkart應用程序上打開特定產品。在那裏,他們有分享按鈕我點擊分享我得到以下鏈接:

http://dl.flipkart.com/dl/united-colors-benetton-sneakers/p/itmee2ahxjhz3pbz?pid=SHOEE2AHDGPBFFZ8&cmpid=product.share.pp

當我點擊鏈接這會打開如下圖所示的對話框:

enter image description here

如果我點擊flipkart會自動在應用程序上打開該產品,或者如果我選擇瀏覽器,它會自動打開網站。

這是如何完成的?我想知道邏輯?有人能幫我解決這個問題嗎?

謝謝!

+0

使用意圖過濾 – Amy

回答

1

嘗試這樣:

<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" /> 
     <data android:host="www.android.com" /> 
</intent-filter> 
+0

什麼會這樣呢?這怎麼能幫助我打開我的APP來顯示所需的產品? –

+0

你能否介紹一下這方面的更多細節? –

+0

你需要什麼細節? – Amy