Android ImageView over ImageView OnTouchListener -


enter image description here

well have 2 imageviews , this. want add touchlistener imageview1. listener not working properly. adding imageview2

 android:focusable="false" 

but not working again

try this. works me correctly when click on imageview2. mainactivity oncreate():

protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);      imageview imageview1 = (imageview) findviewbyid(r.id.imageview1);     imageview1.setontouchlistener(new ontouchlistener() {          @override         public boolean ontouch(view v, motionevent event) {             // todo auto-generated method stub             log.i("imageviewandontouchlistener", "imageview1 ontouch");             return false;         }     }); } 

and in layout xml:

<framelayout     android:layout_width="wrap_content"     android:layout_height="wrap_content" >      <imageview         android:id="@+id/imageview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/image1"/>      <imageview         android:id="@+id/imageview2"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/image2" /> </framelayout> 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -