TextView/HyperLink

HELP! PLEASE DEAR GOD! HELP!

Page 1 of 1

2 Replies - 12319 Views - Last Post: 17 January 2011 - 02:03 AM

#1 kevin_mchugh  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 70
  • Joined: 08-April 09

TextView/HyperLink

Posted 24 October 2010 - 04:39 PM

Hello All,

I come again cup in hand :-)

I am looking for a little help with a University Coursework (Having spent some time with Android their is no way in hell I would be doing this by choice!).I am not asking for a solution or for you to do my work, but could someone please put me out my misery regarding this.

I have a TextView component, which uses the following XML:

<TextView 
android:id="@+id/registerLinkText"
android:autoLink="all"
android:linksClickable="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/login"
android:text="@string/register" />



I have tried providing the following strings:

<string name="register"><a href="http://api.comicvine.com/">Register for API</a></string>


This will make the "Register for API" appear on the screen styled to look like a hyper link, but clicking on it does nothing.

or

<string name="register">http://api.comicvine.com/</string>


If I simply put the URL in as above then I can click on it and it will open a browser etc.

My problem is that I really want it to look like the first attempt but work like the second if you catch my drift. I have had a good Google into this and cannot find anything.

As I said above, I am not looking for someone to do my work for me, just help me out with this annoyance. Its not effecting the program its just bugging me at the moment.

Also if you could tell me how to change the Hyperlink colour.............

Finnaly, thanks for any/all help and apologies to any moderators/ sadists who choose to write android apps, if I have upset any of you by putting this in the wrong place, dissing your platform etc then I apologies.

Regards

Is This A Good Question/Topic? 0
  • +

Replies To: TextView/HyperLink

#2 H3R3T1C  Icon User is offline

  • Android Expert
  • member icon

Reputation: 277
  • View blog
  • Posts: 757
  • Joined: 30-March 07

Re: TextView/HyperLink

Posted 29 October 2010 - 04:16 PM

Try setting the autolink attribute to web. Also try putting <html> in the begin of your string. If it still does not work post back here and ill see if i can find another fix.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Md. Al Amin Chowdhhury*


Reputation:

Re: TextView/HyperLink

Posted 17 January 2011 - 02:03 AM

Try This link, I hope it will work
http://stackoverflow...o-a-web-site-in

View Postkevin_mchugh, on 24 October 2010 - 04:39 PM, said:

Hello All,

I come again cup in hand :-)

I am looking for a little help with a University Coursework (Having spent some time with Android their is no way in hell I would be doing this by choice!).I am not asking for a solution or for you to do my work, but could someone please put me out my misery regarding this.

I have a TextView component, which uses the following XML:

<TextView 
android:id="@+id/registerLinkText"
android:autoLink="all"
android:linksClickable="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/login"
android:text="@string/register" />



I have tried providing the following strings:

<string name="register"><a href="http://api.comicvine.com/">Register for API</a></string>


This will make the "Register for API" appear on the screen styled to look like a hyper link, but clicking on it does nothing.

or

<string name="register">http://api.comicvine.com/</string>


If I simply put the URL in as above then I can click on it and it will open a browser etc.

My problem is that I really want it to look like the first attempt but work like the second if you catch my drift. I have had a good Google into this and cannot find anything.

As I said above, I am not looking for someone to do my work for me, just help me out with this annoyance. Its not effecting the program its just bugging me at the moment.

Also if you could tell me how to change the Hyperlink colour.............

Finnaly, thanks for any/all help and apologies to any moderators/ sadists who choose to write android apps, if I have upset any of you by putting this in the wrong place, dissing your platform etc then I apologies.

Regards

Was This Post Helpful? 0

Page 1 of 1