I have noticed a weird thing in Android. I can't use EditText functions like getText()
- for example, when I type:
final EditText txtUser = (EditText) inflater.inflate(R.layout.layout_dialog, null).findViewById(R.id.txtUsername);
And when I use:
View v = inflater.inflate(R.layout.layout_dialog, null);
final EditText txtUser = (EditText) v.findViewById(R.id.txtUsername);
everything works fine. I noticed that inflater.inflate(R.layout.layout_dialog, null);
returns view, so I don't understand why I can't use getText()
function when I don't use a view instance.
Thank You.