• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to display read-only data on a screen?

RhinoCan

Well-Known Member
My app wants to display a record from a RecyclerView to the user to confirm that the user wants to delete it. I simply want to display the five facts from the sale item - client code, order number, order date, tickets sold, and seller name - to the user on a screen, with each fact prefixed by a label. Then, the user needs to either press the Remove button to confirm the delete or press the Cancel button to abort the delete.

I am having a lot of trouble finding some way to make the labels and "facts" so that no one can edit them. I can't find anything in the API that actually works to make the "fact" fields uneditable. (I thought setTextIsSelectable(false) was the answer but it doesn't work. I also tried turning off editable and clickable but that didn't work either.)

Can someone enlighten me on how to prevent the user from changing anything on this screen? The only things they should be able to do is press the Remove or Cancel buttons.
 
Last edited:
Can't really answer this without seeing code.

Really? I just want to put text on a page that the users see - using a regular layout XML file in the res folder - and prevent the user from modifying it. Imagine a title on a form for a simpler example than the one I cited before.

I want to be clear on whether I want a TextView or some other GUI element and how I would go about making it read-only.
 
Hmm. I think I have this figured out. Despite various remarks on StackExchange that say TextViews *can* be edited, I'm using those for all my fields and it seems to working fine: I can't click on anything but the buttons, which is just what I wanted.
 
Back
Top Bottom