CameraView
CameraView copied to clipboard
setPictureSize() provides wrong resolutions on ANDROID 13 Samsung Devices Eg - A725F
Resolutions received from setPictureSize() which is inside onCreate() 0 = {Size@22153} "1088x1088" 1 = {Size@22154} "1080x1440" 2 = {Size@22155} "1080x1920" 3 = {Size@22156} "1080x2400" 4 = {Size@22157} "1468x3264" 5 = {Size@22158} "1932x2576" 6 = {Size@22159} "1836x3264" 7 = {Size@22160} "1908x4032" 8 = {Size@22161} "2448x3264" 9 = {Size@22162} "2464x3280" 10 = {Size@22163} "2160x3840" 11 = {Size@22164} "3024x3024" 12 = {Size@22165} "3000x4000" 13 = {Size@22166} "3024x4032" 14 = {Size@22167} "3468x4624" None of the resolutions is working ("SizeSelectors must not return Sizes other than those in the input list")
If I add a 500 ms delay using Handler() before setPictureSize() it gives correct values 0 = {Size@22323} "1280x720" 1 = {Size@22324} "1088x1088" 2 = {Size@22325} "1280x960" 3 = {Size@22326} "1440x1080" 4 = {Size@22327} "1920x1080" 5 = {Size@22328} "2400x1080" 6 = {Size@22329} "3264x1468" 7 = {Size@22330} "2576x1932" 8 = {Size@22331} "3264x1836" 9 = {Size@22332} "4032x1908" 10 = {Size@22333} "3264x2448" 11 = {Size@22334} "3280x2464" 12 = {Size@22335} "3840x2160" 13 = {Size@22336} "3024x3024" 14 = {Size@22337} "4000x3000" 15 = {Size@22338} "4032x3024"
This works: new Handler().postDelayed(() -> runOnUiThread(() -> cameraView.setPictureSize(source -> { ......// your code return sizes; })), 500);
This is only reproduced on Samsung Android 13 devices even same model mobile with Android 12 is working fine without errors.