5

I am very new on android and want to write an application that support rtl languages. for that I wrote

android:supportsRtl="true"

on application part of manifest file and call forceRightToLeft on oncreate method of android. The method have following body:

@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private void forceRTLIfSupported() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        getWindow().getDecorView().setLayoutDirection(
                View.LAYOUT_DIRECTION_RTL);
    }
}

but I understand on sdk API 16(Android 4.1) and the version before that didn't supported and action bar show left to right. I search but couldn't find any solution. Please don't minus my code just let me to know and then I will delete it if it is not true question.

Greg
  • 18,111
  • 5
  • 46
  • 68
user3266062
  • 522
  • 1
  • 7
  • 21

1 Answers1

0

Try with Bidi class

see this answer also.

Community
  • 1
  • 1
ahmed_khan_89
  • 2,755
  • 26
  • 49
  • Thanks for answering to my question, I read bindi but this class is for text, isn't it? My problem is about actionbar. I can't have actionbar format in all the APIs. – user3266062 Apr 23 '14 at 05:40
  • Yes it i about texts. I am sorry, I don't have any idea about how to fix the action-bar ... you should may be ask your question more clearer : "How set my ACTION BAR to support right to left ?" and not "my app" . good luck :) – ahmed_khan_89 Apr 23 '14 at 08:37