Thanks for everyone for helping.. but I got workaround for this.
in onCreate method of activity i updated following code:
public class MainScreenActivity extends Activity
{
private static final String TAG = "Recorder";
public static SurfaceView mSurfaceView;
public static SurfaceHolder mSurfaceHolder;
public static Camera mCamera ;
public static boolean mPreviewRunning;
public static SharedPreferences sharedPref;
public static Display display;
public static int swidth,sheight;
@Override
public void onCreate(Bundle savedInstanceState)
{
// Requires import android.view.Window
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.mainscreen_layout);
mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView2);
mSurfaceHolder = mSurfaceView.getHolder();
/*************added code*************/
display = getWindowManager().getDefaultDisplay();
@SuppressWarnings("deprecation")
int width = display.getWidth(); // ((display.getWidth()*20)/100)
@SuppressWarnings("deprecation")
int height = display.getHeight();// ((display.getHeight()*30)/100)
swidth = width;// width*10/100;
sheight = height*5/100;//height*15/100;
TableRow.LayoutParams lp = new TableRow.LayoutParams(swidth,sheight);
lp.span=3;
lp.column=0;
lp.weight=0.05f;
mSurfaceView.setLayoutParams(lp);
/*************added code*************/
. . . .
}
. . . .
}