I have an Activity that has a main.xml with an ImageView. I then launch an other activity and wand to show the same picture that is in the first activity. My second activity's layout is created programmatically with linearlayout (ll). I then use the following:
ImageView img = (ImageView) findViewById(R.drawable.logo);
ll.addView(img);
setContentView(ll);
but i get img to be null, It doesnt work if i change it to R.id.logo which is defined at main.xml