I get O from my SurfaceView object allthough inside the constructor I get a non zero value inside the constructor.
mView=new MainView(this);
FrameLayout fL=new FrameLayout(this);
fL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));
Button zoomIn=new Button(this);
zoomIn.setLayoutParams(new LayoutParams(mView.getwidth()/50,mView.getwidth()/50));
zoomIn.setX(mView.getwidth()/2);
zoomIn.setY(mView.getHeight()/2);
zoomIn.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
mView.mThread.testzoom(1.5f);
mView.mThread.zBackground.setZoomedBitmap();
}
});
fL.addView(mView);
fL.addView(zoomIn);
Log.e("MainActivity","First Start of MainActivity");
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(fL);
I just simply want my button to be centered on frame layout...(the layoutparams are from framelayout because I am importing it so jsut need to call LayoutParams.xxxxxx)
Why is it so? My Buttons have 0 dimensions in x and y!!!