set Date value to TextView - Android User Interface

Android examples for User Interface:TextView Value

Description

set Date value to TextView

Demo Code


//package com.java2s;

import android.graphics.Typeface;
import android.widget.TextView;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static void setDate(TextView dateView, Typeface font) {
        dateView.setTypeface(font);//w w  w . j  a va  2  s  . co m
        dateView.setText(new SimpleDateFormat("EEEE, MMMM d yyyy")
                .format(new Date()));
    }
}

Related Tutorials