2014-06-22 27 views
1

我有这样的布局自动链接手机将无法正常工作

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/RelativeLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="#fff" > 

    <TabHost 
     android:id="@+id/tabhost" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_above="@+id/adView" > 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical" > 

      <TabWidget 
       android:id="@android:id/tabs" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" > 
      </TabWidget> 

      <TextView 
       android:id="@+id/title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:text="@string/app_name" 
       android:textAppearance="?android:attr/textAppearanceLarge" /> 

      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_margin="20dp" > 

       <LinearLayout 
        android:id="@+id/order_layout" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:orientation="vertical" > 

        <ImageView 
         android:id="@+id/logoImage" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center" 
         android:src="@drawable/logo" /> 

        <TextView 
         android:id="@+id/order_content" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_marginTop="10dp" 
         android:layout_weight="1" 
         android:autoLink="phone" 
         android:clickable="true" 
         android:gravity="center_horizontal" 
         android:text="@string/order" 
         android:textSize="18sp" /> 

       </LinearLayout> 

       <LinearLayout 
        android:id="@+id/about_layout" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:orientation="vertical" > 

        <TextView 
         android:id="@+id/about_content" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_gravity="center" 
         android:autoLink="all" 
         android:scrollbars="vertical" 
         android:text="@string/about" /> 
       </LinearLayout> 

       <LinearLayout 
        android:id="@+id/tarrifs_layout" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:orientation="vertical" > 

        <TextView 
         android:id="@+id/tarrifs_content" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_gravity="center" 
         android:autoLink="all" 
         android:scrollbars="vertical" 
         android:text="@string/tarrifs" /> 
       </LinearLayout> 
      </FrameLayout> 
     </LinearLayout> 
    </TabHost> 

    <com.google.android.gms.ads.AdView 
     android:id="@+id/adView" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_alignParentBottom="true" 
     ads:adSize="SMART_BANNER" 
     ads:adUnitId="@string/admob_id" > 
    </com.google.android.gms.ads.AdView> 

</RelativeLayout> 

在TextView中order_content我把字符串: “ \ r \ n 11-22-33 8 999 333 11 22 \ r \ n 8 888 444 22 33 \ r \ n “ 除了第一个电话号码是彩色的(蓝色和下划线),但我不能点击它们并打电话,有人可以帮我吗? p.s.对不起,我的英语

SOLVE - 要评论行:tv_order.setMovementMethod(new ScrollingMovementMethod());

回答

0

问题行:tv_order.setMovementMethod(new ScrollingMovementMethod());