android - 1 listview and 3 buttons. 1 button is not clickable, why? -


I have a section that listsActivity spreads inside 3 buttons and a list view (clickable items), list items And 2 buttons work fine, but do not respond to any click (it's made just like any other). I think that this is something related to the focus of the button, I have already tried Android: Focusable = "true" and "false" but nothing will change.

This is my XML:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: Tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" & gt; & Lt; ListView android: id = "@ android: id / list" android: layout_below = "@ + ID / checkout" Android: layout_width = "match_parent" Android: layout_height = "400dp" & gt; & Lt; / ListView & gt; & Lt; Button android: id = "@ + id / checkall" Android: layout_height = "38dp" Android: layout_width = "wrap_content" Android: Layout_marginLeft = "L9dp" Android: layout_alignParentTop = "true" Android: layout_alignParentLeft = "true" android: text = "Seal Tudus" Android: Background = "# D1D1D1" /> & lt; Button android: id = "@ + id / uncheckall" Android: layout_height = "38dp" Android: layout_width = "wrap_content" Android: layout_marginLeft = "5dp" Android: layout_toRightOf = "@ + id / checkall" Android: layout_alignParentTop = "true "Android: text =" Borrar selección "Android: Background =" #D1D1D1 "Android: Layout_linePrintRight =" True "/> // This is a click that does not accept - & gt; & Lt; Button android: id = "@ + id / mostrar" Android: layout_height = "49dp" Android: Layout_width = "Match_parent" Android: layout_alignParentBottom = "true" android: text = "Mostrar en Mapa" android: background = "# D1 D1D1 "/> & Lt; / RelativeLayout & gt;    

There is no problem with your layout and it works fine behind this code :

  public class MyActivity increases Suchivistar (button Chekol, Anchecol, mostly, @ override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); setContentView (R .layout.activity_my); CheckOl = (button) Find VVBIID (RID check); Uncheckl = (button) Find VVBID ( Raid. Anchecol); searches mostly = (Button) Vivibiaiaidi (Araid. Mestrar); CheckallksetOnClickListener (New View.OnClickListener () {@Override see public void onClick (View) {Toast.makeText (MyActivity.this, "checkall click done ", Toast.LENGTH_SHORT) .show ();}}); uncheckall.setOnClickListener (new View.OnClickListener () {@Override see public void onClick (View) {Toast.makeText (MyActivity.this," uncheckall click Is done, "Toast.LENGTH_SHORT) .show ();}}); mostrar.setOnClickListener (New View.OnClickListener) {@Override Public Zero onClick (see View) {Toast.makeText (MyActivity.this," mostrar Clicks Is done ", Toast.LENGTH_SHORT) .show ();}}); }   

Try to clean your project and 'rebuild' or post your code here

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -