views:

181

answers:

2

Is it possible to convert a Button into a TextView onclick during runtime?

Thanks Chris

+1  A: 

What you are trying to do is a bad design.

Hide the button and show instead a TextView.

Pentium10
Yes, that is what I intend to do. What I want to know is how can I declare both a TextView and a Button in the same position in the XML?
Chris
Keep both the views in FrameLayout and based on your needs make the particular view invisible/gone.
Karan
A: 

You can define a Layout that hold both TextView and Button. At runtime just set ones setVisibility(Visibility.VISIBLE) and the other setVisibility(Visibility.INVISIBLE)

Reflog