onClick not triggered on LinearLayout with child
for every child
android:duplicateParentState="true"
OnClick on linearLayout childs not working first time
Try to make child clickable, all layouts by default are not clickable:
child.setClickable(true);
EDIT
The problem seems to be the focus. It seems that the first click gives the focus to child and the second one actually clicks it.
Android: How to propagate click event to LinearLayout childs and change their drawable
Put
android:duplicateParentState="true"
in your ImageView and TextView..then the views get its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.
Related Topics
Android Studio 3.1 Cannot Resolve Symbol (Themes, Widget, Attr, etc.)
How to Use Recyclerview.Scrolltoposition() to Move the Position to the Top of Current View
Why Ondraw Is Not Called After Invalidate()
The Application Icon Does Not Show on Action Bar
Android Google+ Integration - Repeated Userrecoverableauthexception
How to Use Bluetooth in Android Emulator
Send Auto Email Programmatically
Add Google Maps API V2 in a Fragment
How to Write Jarlist Cache File While Creating Android Project
Android: How to Attach a Temporary, Generated Image to an Email
How to Open Private Files Saved to the Internal Storage Using Intent.Action_View
How to Create a Multilingual Android Application
How to Click or Tap on a Textview Text on Different Words
Sending Mail in Android Without Intents Using Smtp
Android Ndk C++ Jni (No Implementation Found for Native...)
Android 1.5: Reading Sms Messages
Creating an Empty Bitmap and Drawing Though Canvas in Android