get System Country - Android java.util

Android examples for java.util:Locale

Description

get System Country

Demo Code


//package com.java2s;

import java.util.Locale;

public class Main {

    public static String getCountry() {
        String country = null;/*from   www  . ja  va 2  s  .  c  o  m*/
        try {
            country = Locale.getDefault().getCountry();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return country;
    }
}

Related Tutorials