How do I click an Imageview that doesn’t interfere with the application?

Asked

Viewed 49 times

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.

  • If the imageView will take up all the space you could click on the imageView or it would disturb?

  • @ramaral is there the code

  • @Caiqueoliveira it would disturb

  • If the code is just that I see no reason why onClickAcao of Linearlayout don’t be called.

  • @ramaral really the function is being called, the error is in the image comparison R.drawable.image

  • Necessarily have to add an Imageview? Couldn’t work with the Linearlayout background itself?

  • I don’t understand. What do you mean: "error is in image comparison...."?

  • @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 String and made the comparison using .equals() and it worked

Show 4 more comments

1 answer

0


Really the ImagemView did not interfere to call the function onClickAcaoof Linear Layout

Browser other questions tagged

You are not signed in. Login or sign up in order to post.