2017-06-13 60 views
0

在我的應用程序出現在谷歌的按鈕打開其他應用發揮 ,但我想改變它打開likn taht打開我的網站如何更改其他App likn打開瀏覽器的Android應用鏈接

代碼:

this.followImage.setOnClickListener(new View.OnClickListener() 
     { 
     public void onClick(View paramAnonymousView) 
     { 
      OtherApp.openIntentOrInMarket(HomeActivity.this, "mobi.infinityApp.SnapPhoto", "mobi.infinityApp.SnapPhoto.activity.LoadingActivity"); 
      HomeActivity.this.homeClickLog.put("click", "SnapPhoto"); 
      Answers.getInstance().logCustom((CustomEvent)new CustomEvent("home").putCustomAttribute("click", "SnapPhoto")); 
     } 
     }); 
+0

[請格式化代碼正確](https://stackoverflow.com/editing-help) – Dwhitz

回答

0

爲了設置一個按鈕,點擊打開一定的聯繫,請嘗試以下操作:

findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { 
    @Override 
    public void onClick(View v) { 
     Uri uri = Uri.parse("INSERT URL HERE WITH THE APP PROTOCOL"); 
     Intent intent = new Intent(Intent.ACTION_VIEW, uri); 
     startActivity(intent); 
    } 
}); 
相關問題