2012-06-06 99 views
0

我有一個按鈕,必須午餐下載的應用程序。當我點擊按鈕android問我如何打開與瀏覽器或與市場的鏈接。 我可以強迫它使用市場應用程序,因此它不會提示嗎?強制我的應用程序使用市場應用程序,當我打開我的網址

這裏是我的代碼:

String url = "https://play.google.com/store/apps/details?id=org.scid.android"; 

Intent i = new Intent(Intent.ACTION_VIEW); 

i.setData(Uri.parse(url)); 

startActivity(i); 

回答

0

,你不行,很準確。您可以嘗試獲取Android電子市場應用的活動名稱,但這不是一個可靠的方法來做這件事。

這些是隱含的意圖,由於數據類型是一個URL,顯然你會看到一個選項對話框。

2

使用來自the Android developer documentation的 URL語法:

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setData(Uri.parse("market://details?id=org.scid.android")); 
startActivity(intent); 
+0

我厭倦了這一點,所以我得到了其他應用程序,Android的建議日程應用,條碼掃描儀應用程序,Facebook應用程序,Twitter應用和許多其他 –

相關問題