Android Localization problem: Not all items in the layout update properly when switching locales

前端 未结 4 516
北荒
北荒 2021-02-07 18:26

Here\'s the problem: When I have an activity running in the background, and I switch locales, and I switch back to the application, everything updates... EXCEPT checkboxes and r

4条回答
  •  滥情空心
    2021-02-07 19:03

    This 2 years old ticket proposes a workaround of not using the android:id so I fixed this issue by using a similar layout:

    
    
    
        
        
    
        
    
    
    

    So now to get the RadioButton I use something like this:

    private RadioButton getButton(RelativeLayout layout) {
        RadioButton button = null;
        if (layout.getChildCount() != 0) {
            button = (RadioButton) layout.getChildAt(0);
        }
        return button;
    }
    

    So I can set the properties programmatically.

提交回复
热议问题