Avadhani Y
Avadhani Y

Reputation: 7626

String Underline modification in Android

I have a problem with the underlining the textfield used for showing it as the link.

I am using the following code:

     final String Email1 = new String("http://myURL/");
                Email.setText("W : "+Email1);
                Email.setPaintFlags(Email.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

I am getting the output as below :

enter image description here

I am getting the underline for W: also... Please help with the code to omit the underline to W:

Upvotes: 1

Views: 304

Answers (2)

TomDestry
TomDestry

Reputation: 3399

You need to use two TextViews alongside each other. One containing the "W : ", the other with the email address.

Upvotes: 1

Hanry
Hanry

Reputation: 5531

Have you tried???

Html.fromHtml("W:"+"<u>" +Email1+ "</u>);

Upvotes: 2

Related Questions