書道に触発されて、私はコンテキストラッパーを作成することになりました。私の場合、アプリユーザーにアプリ言語を変更するオプションを提供するためにシステム言語を上書きする必要がありますが、これは実装する必要のある任意のロジックでカスタマイズできます。
    import android.annotation.TargetApi;
    import android.content.Context;
    import android.content.ContextWrapper;
    import android.content.res.Configuration;
    import android.os.Build;
    
    import java.util.Locale;
    
    public class MyContextWrapper extends ContextWrapper {
    public MyContextWrapper(Context base) {
        super(base);
    }
    @SuppressWarnings("deprecation")
    public static ContextWrapper wrap(Context context, String language) {
        Configuration config = context.getResources().getConfiguration();
        Locale sysLocale = null;
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {
            sysLocale = getSystemLocale(config);
        } else {
            sysLocale = getSystemLocaleLegacy(config);
        }
        if (!language.equals("") && !sysLocale.getLanguage().equals(language)) {
            Locale locale = new Locale(language);
            Locale.setDefault(locale);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
                setSystemLocale(config, locale);
            } else {
                setSystemLocaleLegacy(config, locale);
            }
            
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
             context = context.createConfigurationContext(config);
        } else {
             context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics());
            }
        return new MyContextWrapper(context);
    }
    @SuppressWarnings("deprecation")
    public static Locale getSystemLocaleLegacy(Configuration config){
        return config.locale;
    }
    @TargetApi(Build.VERSION_CODES.N)
    public static Locale getSystemLocale(Configuration config){
        return config.getLocales().get(0);
    }
    @SuppressWarnings("deprecation")
    public static void setSystemLocaleLegacy(Configuration config, Locale locale){
        config.locale = locale;
    }
    @TargetApi(Build.VERSION_CODES.N)
    public static void setSystemLocale(Configuration config, Locale locale){
        config.setLocale(locale);
    }
}
ラッパーを挿入するには、すべてのアクティビティで次のコードを追加します。
@Override
protected void attachBaseContext(Context newBase) {
    super.attachBaseContext(MyContextWrapper.wrap(newBase,"fr"));
}
更新22/12/2020
ダークモードをサポートするためのContextThemeWrapperのAndroidマテリアルライブラリの実装後、言語設定が壊れ、言語設定が失われます。数か月のヘッドスクラッチの後、Activity and Fragment onCreateメソッドに次のコードを追加することで、問題が解決しました。
Context context = MyContextWrapper.wrap(this, "fr");
   getResources().updateConfiguration(context.getResources().getConfiguration(), context.getResources().getDisplayMetrics());
UPDATE 10/19/2018
向きの変更後、またはアクティビティの一時停止/再開後、構成オブジェクトがデフォルトのシステム構成にリセットされることがあります。その結果、コンテキストをフランス語の「fr」ロケールでラップしたにもかかわらず、アプリに英語の「en」テキストが表示されます。 。したがって、グッドプラクティスとして、アクティビティまたはフラグメントのグローバル変数にContext / Activityオブジェクトを保持しないでください。
さらに、MyBaseFragmentまたはMyBaseActivityで以下を作成して使用します。
public Context getMyContext(){
    return MyContextWrapper.wrap(getContext(),"fr");
}
この方法により、100%バグのないソリューションが提供されます。