What is use of android:supportsRtl="true" in AndroidManifest xml file

92,637

Solution 1

Declares whether your application is willing to support right-to-left (RTL) layouts. If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction associated to the user's Locale choice (your layouts will always be left-to-right).

The default value of this attribute is false.

This attribute was added in API level 17.

(Source: http://developer.android.com/guide/topics/manifest/application-element.html)

Solution 2

if you are building an app in Arabic, Urdu, Hebrew, etc... or any language that is written from right to left you should set android:supportsRtl to true, that's how you tell the layout to be from right to left, and The default value of this attribute is false.

Solution 3

From Android API-Guides:

(developer.android.com/guide/topics/manifest/application-element.html)

Declares whether your application is willing to support right-to-left (RTL) layouts.

If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction associated to the user's Locale choice (your layouts will always be left-to-right).

The default value of this attribute is false.

This attribute was added in API level 17.

Share:
92,637

Related videos on Youtube

pRaNaY
Author by

pRaNaY

Software Engineer | #AndroidDev | Kotlin❤️ | Flutter 💙| Public Speaker 🗣️| MobileSecurity📱 | Cooking 👨‍🍳| Open Source Enthusiastic https://pranaypatel512.github.io/ http://booleancoder.com/ He believes to learn something new every day! | Someday, I'll be a great coder. Try it out, improve it, practice more and have fun! ✌️

Updated on June 01, 2021

Comments

  • pRaNaY
    pRaNaY almost 3 years

    Whenever I created new project in android studio, I got android:supportsRtl="true" in my app AndroidManifest File.

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    ...
    </application>
    

    What is use in app, or what is advantages & disadvantage when I add or not add in my app AndroidManifest .

    • SREE
      SREE over 7 years
      I don't feel this as a duplicate question. Both are regarding RTL, but people who search for these will defer.
    • Jaydev
      Jaydev about 7 years
      The question to which this is referenced as duplicate is wrong. Totally different context for user searching the question.
    • VVB
      VVB over 5 years
  • CopsOnRoad
    CopsOnRoad over 6 years
    Better than Google documentation.
  • Nicoolasens
    Nicoolasens about 5 years
    Thanks to the other responses, but this kind of response is more usefull and complete the documentation. Thank you @Sarah.
  • ozanurkan
    ozanurkan almost 5 years
    hi, my app isn't support arabic language but i am using android:supportsRtl="true" in manifest.xml is this problem ?
  • ToolmakerSteve
    ToolmakerSteve over 4 years
    @ozanurkan - Not a problem. This answer is wrong/misleading. android:supportsRtl="true" enables support for right-to-left languages. Without this, layout will always be left-to-right, However by itself it does not change the layout to be from right to left. It simply enables other attributes - one of those new attributes controls whether is left-to-right or right-to-left.