<span style="font-size:14px;">Camera.Parameters params = mCamera.getParameters();
List<Size> previewSizes = params.getSupportedPreviewSizes();
for(int i=0;i<previewSizes.size();i++){
Log.v("getSupportedPreviewSizes(width)",String.valueOf(previewSizes.get(i).width));
Log.v("getSupportedPreviewSizes(height)",String.valueOf(previewSizes.get(i).height));
if ((previewSizes.get(i).width == 640) && (previewSizes.get(i).height == 480)){
supports_640_480 = true;
}
}
if (supports_640_480){
cameraWidth = 640;
cameraHeight = 480;
params.setPreviewSize(640, 480);
mCamera.setParameters(params);
mCamera.startPreview();
}</span>
获取的SupportedPreviewSizes分别是(width,height):(1280,720),(960,720),(720,480),(640,480),(480,320),(320,240),(176,144)