0
I have a Linear Layout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linear"
android:orientation="horizontal"
android:onClick="onClickAcao">
</LinearLayout>
public void image(ImageView image,int rid,LinearLayout linear )
{
image.setBackgroundResource(rid);
linear.addView(image);
}
And in that Linear layout go a ImagemView created via code, with the imagemView maid in the Linear Layout as image that picks up the whole Linear Layout by clicking on it does not perform linear Layout action, has how to do the ImagemView do not interfere in the action?.
Post the code for the creation of Imageview.
– ramaral
If the imageView will take up all the space you could click on the imageView or it would disturb?
– Caique Oliveira
@ramaral is there the code
– Vale
@Caiqueoliveira it would disturb
– Vale
If the code is just that I see no reason why
onClickAcaoof Linearlayout don’t be called.– ramaral
@ramaral really the function is being called, the error is in the image comparison
R.drawable.image– Vale
Necessarily have to add an Imageview? Couldn’t work with the Linearlayout background itself?
– Thiago Luiz Domacoski
I don’t understand. What do you mean: "error is in image comparison...."?
– ramaral
@ramaral I’ve already solved is the following had stored the figure id in an integer vector while comparing is not identifying that it was equal, which I did convert to
Stringand made the comparison using.equals()and it worked– Vale