How to linkify activity

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

How to linkify activity

Postby hydroxboys » Wed Oct 20, 2010 4:54 pm

I just trying to linkify a text with the Linkify class recently but I'm stuck at how to showing new activity after clicking those links?!
here's the screenshoot of my pages:
Image
There's a 'Register' link that I want to show new Activity after a click takes place.

And this is my code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.tech2eco.login;
  2.  
  3. import java.util.regex.Pattern;
  4.  
  5. import android.app.Activity;
  6. import android.os.Bundle;
  7. import android.text.util.Linkify;
  8. import android.widget.TextView;
  9.  
  10. public class verify extends Activity {
  11.     private TextView regist;
  12.     public void onCreate(Bundle savedInstanceState) {
  13.                 super.onCreate(savedInstanceState);
  14.         setContentView(R.layout.main); 
  15.                 regist=(TextView) findViewById(R.id.lblReg);
  16.         Pattern regit=Pattern.compile("register");
  17.         String uri="content://com.tech2eco.login.register/";
  18.         Linkify.addLinks(regist,regit, uri);
  19.         }
  20. }
  21.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Maybe you are all having a simpler way to done this?
Thanks a lot for your answers.
hydroxboys
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Oct 20, 2010 4:37 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: A Guai, Yahoo [Bot] and 7 guests