I'm at the very early stage of learning Android. Can anyone tell me how I can use the text written in a Text box by user?
I'm trying to use getText() method but finding it confusing.
Thanks in advance.
getText should do it.
you maybe need a string cast?
what is the code you using @ the moment?
example:
EditText editText = (EditText)findViewById(R.id.yourId);
String editTextStr = editText.getText().toString()
docs:
http://developer.android.com/reference/android/widget/TextView.html#getText(
TextBox t = (TextBox)findViewById(R.id.textboxid)
String s = "";
s = t.getText().toString();
Here you can get content of textbox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With