在我的应用中有一个按钮在谷歌播放中打开其他应用程序 但我想改变它打开一个likn taht打开我的网站
代码:
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 :(得分: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);
}
});