Read font size from Settings

前端 未结 4 1984
情深已故
情深已故 2020-11-30 10:52

This question is a almost dublicate of Android App: how to read Font Size under Settings? I read the answer of CommonsWare which points to use Settings.System.FONT_SCA

4条回答
  •  借酒劲吻你
    2020-11-30 11:43

    Add "float def" param to the end of the

    public static float getFloat(ContentResolver cr, String name, float def)
    

    Example:

    scale = android.provider.Settings.System.getFloat(getActivity().getContentResolver(),
                                        android.provider.Settings.System.FONT_SCALE, 1f);
    

提交回复
热议问题