Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Color;
import android.graphics.Paint;

import android.widget.TextView;

public class Main {
    /**
     * This method formats a TextView as if it was a hyperlink. This method
     * is useful when it's not a real HTML link but there's an OnClickListener
     * assigned to the TextView, taking you to some other action.
     *
     * @param t The TextView whose appearance is to be changed.
     */
    public static TextView renderAsLink(TextView t) {
        t.setPaintFlags(t.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
        t.setTextColor(Color.BLUE);
        return t;
    }
}