TextView como link

Top  Previous  Next

Tela

 

Java

 
package com.visual;

 

import android.app.Activity;

import android.os.Bundle;

 

public class VisualActivity extends Activity {

 

 @Override

 protected void onCreate(Bundle icicle) {

         super.onCreate(icicle);

         setContentView(R.layout.link);

 }

}

 

xml

 
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

  android:layout_width="fill_parent"

  android:layout_height="fill_parent"

  android:orientation="vertical" >

 

  <TextView

      android:layout_width="fill_parent"

      android:layout_height="wrap_content"

      android:autoLink="web"

      android:text="http://www.google.com" />

</LinearLayout>