I have a ListActivity in Android. Each row is just an item that starts another activity with some resource. By default this is of course a TextView.
I’d like (and by “I’d like”, I mean “the client insists”) that TextView to look like a button. If I actually make them Buttons, the default list click handler doesn’t work anymore – even if they’re non-focusable – so I have to write code to manually inflate the view containing the button and set a click handler.
Is there some way instead I can just make the TextView look like a Button without any of a Button’s behaviors?
You should be able to just set the style in the layout XML file.
See http://developer.android.com/reference/android/R.style.html for a list of the built-in platform style. Not sure how well it would work, but its reasonably easy to do. Try this:
EDIT: the issue is that the default button style sets the
android:clickableattribute. Try and add theandroid:clickableattribute and set it to false: