Android examples for Internationalization:Locale
set Persian Locale to Context
//package com.java2s; import android.content.Context; import android.content.res.Configuration; import java.util.Locale; public class Main { public static Locale setPersianLocale(Context context) { Locale defaultLocale = Locale.getDefault(); Locale locale = new Locale("fa"); Locale.setDefault(locale); Configuration configuration = new Configuration(); configuration.locale = locale;//ww w .j a v a2s. co m context.getResources().updateConfiguration(configuration, context.getResources().getDisplayMetrics()); return defaultLocale; } }