user1357515
user1357515

Reputation: 13

Android Linkify Email Is Not Supported

I tried to linkify an email address in my Android app, but it didn't work.

Method 1:

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

Method 2:

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

I got "That action is not currently supported" using both methods. Is it a bug? Or I just can't try it out in a

Upvotes: 1

Views: 1925

Answers (2)

MitchellTR
MitchellTR

Reputation: 111

Method 1 is sufficient.

If Android does recognize and "linkify" the email address but you receive an "action is not currently supported" message when you press it in the emulator, ensure that you have configured an email address in the Email app.

Once your email address is configured, pressing one of these links should jump straight to an email composition Activity.

Upvotes: 2

ρяσѕρєя K
ρяσѕρєя K

Reputation: 132992

use both methods for Linkify email address.as

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

and in Layout xml:

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

Upvotes: 2

Related Questions