Problem:change SurfaceView height width in android.
You are using SurfaceView to open camera in Android. and want to set it's custom height and width. So How can you change SurfaceView height width?
Solution:To change SurfaceView's custom height and width use "android.view.ViewGroup.LayoutParams"
There are subclasses of LayoutParams for different subclasses of ViewGroup. For example, AbsoluteLayout has its own subclass of LayoutParams which adds an X and Y value. By this you can change X and Y of SurfaceView
Example:Use below code:
android.view.ViewGroup.LayoutParams avvglp = surfaceView.getLayoutParams();
To See more here: