Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;

import java.util.Calendar;
import java.util.Locale;

public class Main {
    /**
     * @return the localized calendar instance
     */
    public static Calendar getLocalizedCalendar(Context context) {
        return Calendar.getInstance(getLocale(context));
    }

    /**
     * Get the current locale
     */
    public static Locale getLocale(Context context) {
        return context.getResources().getConfiguration().locale;
    }
}