I have very wierd problem when translate the app using translations editor.
So I did like the following( https://stackoverflow.com/a/66483251/14446860 ) and it work,I have 3 activies,when I press the button in the first activity it changes the language perfectly for all activities. However when I change the language back to default,the first activity and the third activity are perfect restored,but the second activity(Map activity) textview is not changing,even if I re-install the app and doesn't press the change language button,the second activity is not in the default language..
This is app Manifest:
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:configChanges="locale"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MapsActivity"
android:screenOrientation="portrait"
android:launchMode="singleTop"
/>
The string file in default folder:
<string name="contact_name">Test:</string>
<string name="destination">Test:</string>
<string name="messageMaps">Test:</string>
The string file in the language folder:
<string name="contact_name">בדיקה:</string>
<string name="destination">בדיקה:</string>
<string name="messageMaps">בדיקה:</string>
The button:
Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (LANG_CURRENT.equals("en")) {
changeLang(getApplicationContext(), "iw");
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
} else {
changeLang(getApplicationContext(), "en");
}
finish();
startActivity(new Intent(getApplicationContext(), MainActivity.class));
}
});
Thank you !