Best code examples for Android EditText class (android.widget.EditText)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android EditText class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android EditText examples from Open Source projects
Examples using Android EditText getText method:
This code example shows how to use the following methods: getText
24:	String name = edit.getText().toString(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText
61:	focus(password); 
-
63:	assertEquals("password", password.getText().toString()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText
78:	String name = myEditText.getText().toString(); 
Full Snippet Info
8
CodeRank
Examples using Android EditText setSelection method:
This code example shows how to use the following methods: setSelection, getSelectionEnd, getSelectionStart, setTransformationMethod
62:	int start=field.getSelectionStart(); 
63:	int end=field.getSelectionEnd(); 
-
66:	field.setTransformationMethod(null); 
-
69:	field.setTransformationMethod(new PasswordTransformationMethod()); 
-
72:	field.setSelection(start, end); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setSelection, getSelectionEnd, getSelectionStart, setTransformationMethod
62:	int start=passphrase.getSelectionStart(); 
63:	int end=passphrase.getSelectionEnd(); 
-
69:	passphrase.setTransformationMethod(new PasswordTransformationMethod()); 
-
72:	passphrase.setSelection(start, end); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText, setSelection
69:	editText.setSelection(editText.getText().length()); 
Full Snippet Info
7
CodeRank
Examples using Android EditText selectAll method:
This code example shows how to use the following methods: selectAll
135:	queryTextView.selectAll(); 
Full Snippet Info
7
CodeRank
Examples for other Android EditText methods:
Related Android EditText Questions & Answers:
Other Android EditText Examples
10:	public class FirstScreenActivity extends Activity {
11:		// Initializing variables
12:		EditText inputName;
13:		EditText inputEmail;
14:		@Override
-
11:		// Initializing variables
12:		EditText inputName;
13:		EditText inputEmail;
14:		@Override
15:		public void onCreate(Bundle savedInstanceState) {
-
17:			setContentView(R.layout.screen1);
18:	
19:			inputName = (EditText) findViewById(R.id.name);
20:			inputEmail = (EditText) findViewById(R.id.email);
21:			Button btnNextScreen = (Button) findViewById(R.id.btnNextScreen);
-
18:	
19:			inputName = (EditText) findViewById(R.id.name);
20:			inputEmail = (EditText) findViewById(R.id.email);
21:			Button btnNextScreen = (Button) findViewById(R.id.btnNextScreen);
22:

Read More

20:		
21:		// Search EditText
22:		EditText inputSearch;
23:		
24:		
-
37:	        
38:	        lv = (ListView) findViewById(R.id.list_view);
39:	        inputSearch = (EditText) findViewById(R.id.inputSearch);
40:	        
41:	        // Adding items to listview

Read More

17:		
18:		// UI elements
19:		EditText txtName;
20:		EditText txtEmail;
21:		
-
18:		// UI elements
19:		EditText txtName;
20:		EditText txtEmail;
21:		
22:		// Register button
-
50:			}
51:			
52:			txtName = (EditText) findViewById(R.id.txtName);
53:			txtEmail = (EditText) findViewById(R.id.txtEmail);
54:			btnRegister = (Button) findViewById(R.id.btnRegister);
-
51:			
52:			txtName = (EditText) findViewById(R.id.txtName);
53:			txtEmail = (EditText) findViewById(R.id.txtEmail);
54:			btnRegister = (Button) findViewById(R.id.btnRegister);
55:

Read More

1:	EditText editText = (EditText) findViewById(R.id.search);
2:	editText.setOnEditorActionListener(new OnEditorActionListener() {
3:	    @Override
-
1:	EditText editText = (EditText) findViewById(R.id.search);
2:	editText.setOnEditorActionListener(new OnEditorActionListener() {
3:	    @Override

Read More

EditText Class Overview
EditText is a thin veneer over TextView that configures itself to be editable.

See the Text Fields guide. XML attributes See...
Methods
  • getText
    Return the text the TextView is displaying.
  • selectAll
    Convenience for selectAll(Spannable).
  • setText
    Sets the text that this TextView is to display (see setText(CharSequence)) and also sets whether it is stored in a styleable/spannable buffer and whether it is editable.