2009-10-29 75 views

回答

15

一下添加到該按鈕的OnClickListener的onClick方法:

Intent marketLaunch = new Intent(Intent.ACTION_VIEW); 
marketLaunch.setData(Uri.parse("market://search?q=uk.co.ashtonbrsc")); 
startActivity(marketLaunch); 

與搜索詞,會發現你的應用程序更換uk.co.ashtonbrsc

25

更妙的是用「市場://詳細信息」,而不是「市場://搜索」:

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setData(Uri.parse("market://details?id=com.android.example")); 
startActivity(intent); 

然後直接打開應用的詳細信息頁面。通過搜索它會顯示單個搜索結果,用戶必須再點擊一下才能進入詳細信息頁面。

相關問題