Is Context Chinese - Android Internationalization

Android examples for Internationalization:Chinese

Description

Is Context Chinese

Demo Code


//package com.java2s;
import java.util.Locale;

import android.content.Context;

import android.content.res.Configuration;
import android.content.res.Resources;

public class Main {
    /**//from  ww  w  .  j  a  va2  s.c o m
     * @param context
     * @return
     */
    public static boolean getIsChinese(Context context) {
        Resources resource = context.getResources();
        Configuration config = resource.getConfiguration();
        if (config.locale == Locale.CHINESE) {
            return true;
        }
        return false;
    }
}

Related Tutorials