Android/View

In an Activity, specify which View is to control the layout;
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the content view to be what is defined in the res/layout/main.xml file setContentView(R.layout.main); .. }

find a View and cast it to the correct type;
returnedImageView = (ImageView) findViewById(R.id.ReturnedImageView);

show a view;
someView.setVisibility(View.VISIBLE);

hide a View
someView.setVisibility(View.GONE);

get the height and width of a View in the view itself
getHeight and getWidth will return 0 if called from onCreate, use this method as a work-around

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); View view = findViewById(R.id.main_my_view); view.post(new Runnable { //Get size of view after layout @Override public void run {   Log.d(TAG, "view has width: "+view.getWidth + " and height: "+view.getHeight);     }    }); }

ef