我只是Android的新手, 如何更改通话按钮成为Twitter / Facebook或链接网站的链接按钮
// ------------ Call button---------------------
private void call() {
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+Info.phoneNumber+""));
startActivity(callIntent);
} catch (ActivityNotFoundException activityException) {
}
}
public void btnPhone(View v) {
try {
call();
} catch (Exception e) {
// TODO: handle exception
}
}
主要
<TableRow
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:onClick="btnPhone" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/call" />
</TableRow>
信息
public static String phoneNumber = "+xxxxxx";
答案 0 :(得分:0)
你需要更新......
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);