2012-04-26 67 views
1

我試圖鏈接我的Android應用程序的電子郵件地址,但它沒有奏效。Android Linkify電子郵件不支持

方法1:

<TextView 
    android:id="@+id/email" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/email_address" 
    android:autoLink="email"/> 

方法2:

Linkify.addLinks((TextView)view.findViewById(R.id.email), Linkify.EMAIL_ADDRESSES); 

我 「這個動作目前不支持」 使用這兩種方法。這是一個錯誤嗎?或者,我只是不能嘗試一下在

+0

查看是您的佈局名稱? – 2012-04-26 02:40:09

回答

2

方法1就足夠了。

如果Android確實識別並「鏈接」了電子郵件地址,但當您在模擬器中按下它時收到「當前不支持操作」消息,請確保您已在電子郵件應用程序中配置了電子郵件地址。

一旦您的電子郵件地址被配置,按下其中一個鏈接應該直接跳到一個電子郵件組成活動。

2

使用這兩種方法對Linkify電子郵件address.as

TextView textView = (TextView)findViewById(R.id.email);  
Linkify.addLinks(textView, Linkify.EMAIL_ADDRESSES); 

和佈局的xml:

<TextView 
    android:id="@+id/email" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/email_address" 
    android:autoLink="email"/> 
相關問題