0

I mean something like this

public class ConditionalEditText extends EditText implements TextWatcher
{
    TextView tv;
    ....
}

The TextView is supposed to be displayed only when the EditText satisfies some user specified condition.

I tried to do it like this

public class ConditionalEditText extends LinearLayout implements TextWatcher
{
    EditText edt;
    TextView tv;
    ....
}

but then I cannot specify different XML attributes for edt for different instances of the view in my main layout.

iTwenty
  • 953
  • 8
  • 19

2 Answers2

2

no, only ViewGroup can have child Views

pskink
  • 23,874
  • 6
  • 66
  • 77
0

Turns out there is a way to do this after all. You can anchor a PopupWindow containing any view(s) you want to another View, which is just what I wanted. I got the code to do so from this link and modified it for my needs.

http://code.google.com/p/simple-quickactions/

All thanks to Qberticus for making it!

Community
  • 1
  • 1
iTwenty
  • 953
  • 8
  • 19