Created
January 5, 2012 01:39
-
-
Save tikitikipoo/1563245 to your computer and use it in GitHub Desktop.
Androidにおける設定国を取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.res.Configuration; | |
import android.content.res.Resources; | |
public static String getCountry(Context context) { | |
Resources rs = context.getResources(); | |
Configuration cf = rs.getConfiguration(); | |
String country = cf.locale.getCountry(); | |
return country; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment