当我添加一个按钮时,它应该让我将应用程序skype到用户(name_here)..如果Skype在我的手机上不存在,则会转到https://play.google.com/store/apps/details?id=com.skype.raider
代码是
raskypelink.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
if (uri.contains("https://www.skype.com/" )) {
String name_here = "name_here";
String uri1 = "skype://Page/" + name_here;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
startActivity(intent);
} else {
String skype = "skype";
String uri1 = "https://play.google.com/store/apps/details?id=com.skype.raider" + skype;
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri1));
startActivity(i);
}
}
});
请帮忙!
答案 0 :(得分:0)
For IF
Android文档 - http://developer.skype.com/skype-uris/skype-uri-tutorial-android
For ELSE
从
改变String uri1 = "https://play.google.com/store/apps/details?id=com.skype.raider" + skype;
要
删除+ skype
String uri1 = "https://play.google.com/store/apps/details?id=com.skype.raider";