Get & set text on view

To get a string/value:

EditText e1 = (EditText)findViewById(;
	int i = Integer.parseInt(e1.getText().toString());

To set from an activity:


To set from a fragment:


To use a string from strings.xml:



This entry was posted in Android. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *