I am facing problem for displaying camera preview in android 2.3.6 device.I have used this code for changing camera orientation but for 2.3.6 it is not working and for other versions it is working properly.
First image in device 2.2.1,Second image in device 2.3.6.I want camera preview as same as in 2.2.1 for device 2.3.6.Below is my code
if (Integer.parseInt(Build.VERSION.SDK) >= 8)
{
mCamera.setDisplayOrientation(90);
}
else
{
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
p.set("orientation", "portrait");
p.set("rotation", 90);
}
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
p.set("orientation", "landscape");
p.set("rotation", 90);
}
}
And i have specified screen orientation portrait in manifest.Kindly suggest me a solution.Thanks in advance.