why onConfigurationchanged is not called for android:configChanges="locale"? -


i want when change language occurs. put activity in manifest.xml in attribute andorid:configcahnges locale:

        <activity         android:name=".mainactivity"         android:configchanges="orientation|keyboardhidden|screensize|locale"         android:hardwareaccelerated="true"         android:label="@string/app_name"         android:theme="@android:style/theme.devicedefault.noactionbar.fullscreen" >         <intent-filter>             <action android:name="android.intent.action.main" />              <category android:name="android.intent.category.launcher" />         </intent-filter>                    </intent-filter>     </activity> 

but when run app , go setting , change language method onconfigurationchanged isn't call in mainacitvity. why? docs android says should. develop api 16.

i find out if put add android:configchanges layoutdirection , set android:minsdkversion="17" method called. (i run app on 4.2.2)

but couldn't refresh text new language. try call:

 getresources().updateconfiguration(newconfig, getresources().getdisplaymetrics()); 

in onconfigurationchanged without success. :(

you have define android:configchanges="layoutdirection|locale" in order onconfigurationchanged() called.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -