0

Let's say I have the default strings in res/values/strings.xml. They are in English. The android:supportsRtl="true" in the AndroidManifest.xml.

A user with the system language Hebrew opens my app, and they see all English strings drawn right-to-left.

Is there any way to specify that the default locale is LTR? I've tried to set tools:locale="en", but that didn't help.

I don't think it's a good idea to disable the "supportsRtl". For example, if I have the Arabic translation, I want it to be displayed RTL. But for Hebrew users it should be the default English version LTR.

Please help.

Paebbels
  • 15,573
  • 13
  • 70
  • 139
Sergiy
  • 221
  • 3
  • 11

1 Answers1

0

set this code before layout load.

Configuration config = new Configuration();
config.locale = new Locale("set default local language");
getBaseContext().getResources().updateConfiguration(config,getBaseContext().getResources().getDisplayMetrics());
Pratik18
  • 365
  • 1
  • 7