android - One of the ImageButton not clicking & make HorizontalScrollView clickable -


This is a very silly problem, but it is not working for me.

I have 2 imagebutton & amp; One horizontal scroll view on one page (HSV) is not a click on the odd one image button (1A). Apart from this, I wanted to make HSV clickable so that I can use it:

android: clickable = "true" , which does not work

You can use XML & amp; As soon as I posted

This is XML:

   gt; imageButton Android: id = "@ + id / buy_imageButton" Android: layout_width = "wrap_content" & Lt; / RelativeLayout & gt; & Lt; ListView Android: id = "@ + id / chat_page_list" Android: layout_width = "fill_parent" Android: layout_height = "match_parent" /> & Lt; RelativeLayout Android: layout_width = "fill_parent" android: layout_height = "70dp" Android: layout_alignParentBottom = "true" Android: orientation = "horizontal" & gt; & Lt; HorizontalScrollView android: id = "@ + id / chat_message_HSV" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: layout_toLeftOf = "@ + id / send_image_button" qualified Android: click = "true" / & gt; & Lt; ImageButton android: id = "@ + id / send_image_button" Android: layout_width = "75dp" Android: layout_height = "75dp" Android: layout_alignParentRight = "true" Android: layout_centerVertical = "true" android: src = "@ drawable / Aisi_lancr" /> & Lt; / RelativeLayout & gt; & Lt; / RelativeLayout & gt;   

It is activity file:

  expands the main activity of the public square (ImageButton buyIB; ImageButton sendIB; Kshatijaskrrolwu Catmasejacsvi: @ Override protected void Create (Bundle Saved InstantState) {Super.New (Saved Instantstate); requestWindowFeature (Window.FEATURE_NO_TITLE); setContentView (R.layout.activity_main); SendIB = (ImageButton) findViewById (R.id.send_image_button); ChatMessageHSV = (HorizontalScrollView) findViewById (R.id.chat_message_HSV); BuyIB = (Image Button) Find VibibId (RID) Bi_imejbtn); buyIB.setOnClickListener (New OnClickListener () {@Override public void onClick (View arg0) {Toast.makeText (MainActivity.this, "buy", Toast.LENGTH_SHORT) .show ();}}); chatMessageHSV.setOnClickListener (new View.OnClickListener () {@Override see public void onClick (v) {Toast.makeText (MainActivity.this, "HSV", Toast.LENGTH_SHORT) .show ();}}); sendIB.setOnClickListener (new OnClickListener ( ) {@Override Public Zero onClick (see arg0) {Toast.makeText (MainActivity.this, "Send", Toast.LENGTH_SHORT) .show ();}}); } // the end of the onCreate //   

and I can not use the button

  click on Public Zero (see View) {}   

Because in the actual problem there is a drawer layout where I am using pieces & amp; This method does not work there.

ImageButton to ListView first response because it ImageButton is up, it tries to re-when I ImageButton < Click

HorizontallScrollView about Touch Event instead of click had resolved to use try this code < Pre> chatMessageHSV.setOnTouchListener (New OnTouchListener () {@Override Arwajnik Boolean onTouch (see V, MotionEvent event) {if (event.getAction () == MotionEvent.ACTION_DOWN) {toast .makeText (ImageButtonActivity.this, "HSV", Toast.LENGTH_SHORT) .show ();} else if ( Event.getAction () == MotionEvent.ACTION_UP} {here // code if touching} return false;}});

Feed me back

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -