天天看點

Android 11.0 Camera 按不同裝置尺寸預設不同分辨率

private void setEntries(Preference preference) {
            if (!(preference instanceof ListPreference)) {
                return;
            }

            ListPreference listPreference = (ListPreference) preference;
            if (listPreference.getKey().equals(Keys.KEY_PICTURE_SIZE_BACK)) {

++                SharedPreferences pref = getActivity().getSharedPreferences("CameraFlag",MODE_PRIVATE);
++                if (!pref.getBoolean("flag",false)) {
++                    if ("3".equals(SystemProperties.get("鍵盤參數"))){  //A型機器
++                        listPreference.setValue("640x480");  
++                    }else{      //B型機器
++                        listPreference.setValue("1280x720");    
++                    }
++                }
}