Hi,
I am new to java and developing on android so am trying out a few little
ideas.
I am trying to make some text in a TextView or EditText be clickable just
like a hyperlink. There doesnt seem to be too much available on the web but
here is what I have so far.
public void onCreate(Bundle savedInstanceState) {
> super.onCreate(savedInstanceState);
> setContentView(R.layout.main);
>
> final EditText tv = (EditText)findViewById(R.id.txtView);
> //tv.setOnClickListener(txtClicked);
>
> Spannable span = (Spannable) tv.getText();
> URLSpan url = new URLSpan("www.google.co.uk") {
>
> /* (non-Javadoc)
> * @see
> com.loosenoose.hyperlinktext.myURLSpan#onClick(android.view.View)
> */
> @Override
> public void onClick(View widget) {
> // TODO Auto-generated method stub
> tv.setText("URL Clicked!");
>
> super.onClick(widget);
> }
>
> };
> span.setSpan(url, 0, 5, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
>
My problem is that the onClick event never seems to be called when
debugging. Can someone please help?
cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---