I draw the image in my own code, and I need to pass the screen size to C.
I tried to get the height using the getHeight () view, but returns 0 always even after calling setContentView.
RelativeLayout masterLayout = new RelativeLayout(this);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
masterLayout.setLayoutParams(params);
setContentView(masterLayout);
when I try masterLayout.getHeight (), it returns 0. I expected to get the full height of the screen, as I said fill_parent.
source
share