Siva Kumar Siva Kumar - 1 year ago 72
Android Question

Make EditText behave as a TextView in code

How to make an EditText look like a TextView that is done in Java but not in XML..

I have seen how to do it using xml file like


but i want this to be done in java because i am not using any xml file for the layout..
everything is done in code itself ..
I am trying to use GestureListener in my code .. it worked fine for TextView but not EditText
So, anything to do for the EditText so that the GestureEvents can be implemented ?


Answer Source

EditText is a subclass of TextView - so except for editing, what applies to TextView applies to EditText as well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download