shankey shankey - 1 year ago 100
Android Question

How to Remove Underline from hyperlink's text in android ?

I have Button and its text, I retrive it from string.xml i.e.
I have declared a Button text in res/values in strings.xml like

<string name="Google"><a href=""\">Google</a></string>

I removed its text color from blue to white but how do I remove its underline?
in my .java file I am using only
to make the link clickabale... I didn't use
, webview or anything like form.Html...
everything works fine. I just want to remove the underline below that "Google" text...
Is there any way to do this in the xml?

I even used
. But when I used that, the text and button color changes and I dont want that.

Please Help.

Answer Source

after trying a lot finally i found the solution. I removed the link from string.xml and added this code in my java file.

Button btnGoogle = ( Button GoogleAlert.findViewById(
                LinkMovementMethod.getInstance() );
            btnGoogle.setOnClickListener( new OnClickListener()
                public void onClick( View v )
                    Uri uri = Uri.parse(
                        "" );
                    Intent intent = new Intent( Intent.ACTION_VIEW, uri );
                    startActivity( intent );
            } );

and it worked perfectly.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download