You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a SettingFragment that contains options to change app language, for example when I change language to french I must set the menu to the LEFT ;setMode(SlidingMenu.LEFT), and when I change it to arabic I must set the languague to the RIGHT setMode(SlidingMenu.RIGHT).
To achieve taht I use the observer pattern as following :
MainActivity extends FragmentActivity {
....
@Override
public void propertyChange(PropertyChangeEvent event) {
final String mLanguge = (String) event.getNewValue();
Log.v("Langue",mLanguge );
MainMenuActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if(mLanguge .equals(getResources().getString(R.string.params_arabe_key_pref)))
menu.setMode(SlidingMenu.RIGHT);
else
menu.setMode(SlidingMenu.LEFT);
// refresh the SlidingMenu
menu.invalidate();
}
});
}
(Note this methode is declared inside the MainActivity and it's called when the user change the app language)
The text was updated successfully, but these errors were encountered:
cloudshooterhuman
changed the title
update SlidingMenu Mode inside non-UI Thread
update SlidingMenu Mode from an other Fragment
Jul 18, 2016
cloudshooterhuman
changed the title
update SlidingMenu Mode from an other Fragment
update SlidingMenu Mode from another Fragment
Jul 18, 2016
Hi,
I have a
SettingFragment
that contains options to change app language, for example when I change language to french I must set the menu to the LEFT ;setMode(SlidingMenu.LEFT)
, and when I change it to arabic I must set the languague to the RIGHTsetMode(SlidingMenu.RIGHT)
.To achieve taht I use the observer pattern as following :
(Note this methode is declared inside the
MainActivity
and it's called when the user change the app language)The text was updated successfully, but these errors were encountered: