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.text.DateFormatSymbols;
import java.util.Arrays;

import java.util.Locale;

public class Main {
    /**
     * @return Get the array for week days for the current locale
     */
    public static String[] getWeekDaysList(Context context) {
        DateFormatSymbols symbols = new DateFormatSymbols(getLocale(context));
        return Arrays.copyOfRange(symbols.getShortWeekdays(), 1, 8);
    }

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