A
A
AleAleA2018-06-22 11:35:51
Java
AleAleA, 2018-06-22 11:35:51

How to link to an image from another layout?

Hello, to replace an image in a layout programmatically, in my case, you need to refer to an image from another layout of another activity. There is: the first activity, which is extended (implements) by the second activity, each activity has its own layout. I need to refer from the first activity to the image located in the layout of the second activity.
How to do this based on the image replacement code below?

ImageView img= (ImageView) findViewById(R.id.image);
img.setImageResource(R.drawable.my_image);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question