Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4564216
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:28:10+00:00 2026-05-21T18:28:10+00:00

I have a ListActivity in Android. Each row is just an item that starts

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:28:11+00:00Added an answer on May 21, 2026 at 6:28 pm

    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:

    <TextView android:layout_height="wrap_content" style="@android:style/Widget.Button" android:layout_marginRight="5sp" android:text="" android:layout_width="fill_parent"></TextView>
    

    EDIT: the issue is that the default button style sets the android:clickable attribute. Try and add the android:clickable attribute and set it to false:

    <TextView android:layout_height="wrap_content" style="@android:style/Widget.Button" android:layout_marginRight="5sp" android:text="" android:clickable="false" android:layout_width="fill_parent"></TextView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting my feet wet with Android and have built a UI that
I have an Android ListActivity that is backed by a database Cursor through a
Making this tutorial: http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html I have ListActivity-derived class and onCreateContextMenu, onContextItemSelected overrides. I think
I have an android ListActivity that creates multiple buttons (from a database source) via
In android, I have a List Activity (subclass from ListActivity). And i want to
I have ListActivity , onClick of each item a Custom Dialog appears. Custom Dialog
I have an Android app with a ListActivity in the main view. The list
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have two ListActivity classes that I want to pass into into a third
I have a ListActivity which has an adapter that crashes. Here is the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.