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.widget.TextView;

public class Main {
    /**
     * Will parse a color and set it as text color
     * @param color a string that can be converted into a hex color e.g #000fff
     * @param v textview
     */
    public static void setTextColor(String color, TextView v) {
        v.setTextColor(Color.parseColor(color.isEmpty() ? "#000000" : color));
    }
}