Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.text.format.Time;

import java.util.Calendar;

public class Main {
    /**
     * transform a Time object into an equivalent Calendar (used in display events)
     * @param time
     * @return
     */
    public static Calendar timeToCalendar(Time time) {
        long millis = time.toMillis(false);
        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(millis);
        return cal;
    }
}