• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Anybody tel me,,how to convert editable text to string

final EditText text = (EditText)findViewById(R.id.text);
System.out.println( "The String: " + text.getText().toString() );
 
i always get a message saying "id cannot be resolved"

my code is as follows:
txtbox1= (EditText) findViewById(R.id.txtbox1);
button1 = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.tv);
txtbox2= (EditText) findViewById(R.id.txtbox2);
 
Post your xml -- you're probably not creating the views correctly. You need to have something like:
<EditText android:id="@+id/text"
etc

(note the + before the id)

If you do have this, make sure your xml is saved and doesn't have any other errors in it.
 
Back
Top Bottom