2013-10-15 130 views
0

我只是一個新手針對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

您需要更新像...

Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); 
startActivity(browserIntent);