Android how to detect/register language/locale change listener/receiver

The easy way is to register a BroadcastReceiver for Intent.ACTION_LOCALE_CHANGED.

Example: change your ViewModel data when language/locale changed.

public class QASViewModel extends ViewModel {
    private final FragmentActivity activity;

    public QASViewModel(@NonNull FragmentActivity activity) {
        this.activity = activity;

    private void setLangReceiver() {
        final QASViewModel qasViewModel = this;
        final BroadcastReceiver langReceiver = new BroadcastReceiver() {
            public void onReceive(Context context, Intent intent) {
                // do action when language change
                new IntentFilter(Intent.ACTION_LOCALE_CHANGED));

Subscribe to Post, Code and Quiet Time.

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.