Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Non Editable Text Field

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make my text field non editable but use it to display results from my calculations? I want a look similar to EditText and that's why I don't want to use TextView.

Thanks
Imad
 
Ksh Aggarwal
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muhammad Imad Qureshi wrote:How can I make my text field non editable but use it to display results from my calculations? I want a look similar to EditText and that's why I don't want to use TextView.


I suppose you can set the editable property to true or false in the layout xml file
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
focusable & focusableInTouchMode attributes might be of some help Or
I think, you can put a background(use the same 9-patch drawable used for the EditText) on the TextView to make it look similar to EditText.
 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying. Setting focusable to false in my layout.xml file worked. Setting editable might also work but its deprecated. Thanks to both of you for replying.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic