Hello im interested in getting the layouts width and height using android once the layout has been loaded, and then depending on the these measurements to create pictures , textboxes , button with proper dimensions for the Android device that my game runs into ! How is this possible ? in which function should i put the following code :
layout.getWidth();
layout.getHeight();
so it wont return 0 ? It would be a lot more convenient to achieve the above getting the width and height before the form actually loads but from what i have seen this much more difficult Here is my code so far trying to get these measurements :
protected void onStart() {
super.onStart();
txt = (TextView) findViewById(R.id.textView);
img = (ImageView) findViewById(R.id.imageView2);
layout = (RelativeLayout) findViewById(R.id.MyLayout);
GameHandler();
}
public void GameHandler()
{
txt.setText(""+layout.getHeight()) ; //this always returns 0
}
thank you for your help :)