4

I have the following warning (from the Lint) on each TextView with an ID in my XMLs.

Consider making the text value selectable by specifying android:textIsSelectable="true"

Can anyone please explain me why does it suddenly (from ADT 21.1) happening? Why does the Lint thinks that I want each TextView to be selectable?

EDIT: I know it can be ignored, but I don't think it's a solution.

Yaniv
  • 3,321
  • 8
  • 30
  • 45
  • possible duplicate of [Hide warnings in layout files](http://stackoverflow.com/questions/15205569/hide-warnings-in-layout-files) – David Wasser Mar 12 '13 at 12:43
  • I've seen this question and there were asked how to hide this. I don't want to hide this issue, I want to know why Lint tells me to consider this. – Yaniv Mar 12 '13 at 12:48

1 Answers1

10

If you make the TextView selectable, users can use copy/paste on it. Obviously the "lint" developers thought that was a good thing, so they warn you if you don't do it. There are lots of lint warnings that are just "suggestions", which is why there are easy ways to turn these warnings off.

David Wasser
  • 93,459
  • 16
  • 209
  • 274
  • 1
    Well, it's a little weird, why should them suggest me such things? I think that I can know by myself when I want such a TextView. Thanks anyway. – Yaniv Mar 12 '13 at 13:18
  • lint is like that :-) It catches errors in your code, and also potential errors in your code, and it also makes suggestions to improve code readability, efficiency, style, etc. A lot of warnings you get from lint are just that: "suggestions". – David Wasser Mar 12 '13 at 13:27
  • 2
    @Yaniv, no, typically you as developer don't know this in all cases. Users tend to create much more creative workflows with your app than you ever intended. And that might find workflows where copying some textfield makes perfect sense for them, while you would never imagine this. Lint is not telling that you might want each text field selectable, Lint is telling that your users may want this! – Bananeweizen Mar 28 '13 at 17:27