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
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
This code example shows how to use the following methods: setEnabled, setInputType, setMaxHeight, setText
43:	mEditText = new EditText( activity ); 
-
46:	mEditText.setText(text); 
-
48:	mEditText.setEnabled( editable ); 
49:	mEditText.setMaxHeight( 250 ); 
-
52:	mEditText.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD ); 
Full Snippet Info
9
CodeRank
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: getText
39:	String _lon=lon.getText().toString(); 
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: setText
37:	mEditText.setText(text); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setText
36:	EditText editText = new EditText(context); 
37:	editText.setText(Html.fromHtml("<b>some</b> html text")); 
38:	assertThat(editText.getText().toString()).isEqualTo("<b>some</b> html text"); 
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
This code example shows how to use the following methods: selectAll
135:	queryTextView.selectAll(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTag, setText
136:	EditText editText = new EditText( null ); 
137:	editText.setTag( "foo" ); 
138:	editText.setText( "Bar" ); 
139:	androidMetawidget.addView( editText ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
53:	selection.setText(edit.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
52:	EditText editText = new EditText(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
45:	searchFor(search.getText().toString()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText, getSelectionEnd, getSelectionStart
41:	Editable text=editor.getText(); 
-
44:	text.insert(editor.getSelectionStart(), "\t"); 
-
47:	int rawStart=editor.getSelectionStart(); 
48:	int rawEnd=editor.getSelectionEnd(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setLayoutParams, addTextChangedListener, setMaxLines, setMinLines, setOnEditorActionListener
65:	mKeyInTextView = new EditText ( activity ); 
-
67:	mKeyInTextView.setText ( "" ); 
68:	mKeyInTextView.setMinLines ( 1 ); 
69:	mKeyInTextView.setMaxLines ( 1 ); 
-
71:	mKeyInTextView.addTextChangedListener ( new TextWatcher () { 
-
90:	mKeyInTextView.setOnEditorActionListener(new OnEditorActionListener() { 
-
105:	mKeyInTextView.setLayoutParams ( paramsKeyInTextView ); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getText, setText
132:	String message = inputView.getText().toString(); 
-
138:	inputView.setText(""); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setText
65:	String text = mUserText.getText().toString(); 
-
67:	mUserText.setText(null); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: requestFocus, setOnFocusChangeListener, setHint, setInputType, setText
64:	EditText input = new EditText(context); 
65:	input.setInputType(InputType.TYPE_CLASS_TEXT); 
66:	input.setText(mValue); 
-
69:	input.setHint(mHint); 
-
73:	input.setOnFocusChangeListener(new View.OnFocusChangeListener() { 
-
81:	input.requestFocus(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setText
37:	mEditText.setText(text); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setText
45:	return Integer.parseInt(number.getText().toString()); 
-
50:	number.setText(Integer.toString(value)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEnabled, setInputType
40:	mEditText = new EditText( activity ); 
41:	mEditText.setEnabled( true ); 
42:	mEditText.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD ); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setText
129:	mServerView.setText("  "); 
-
132:	mServerView.setText("serv$er.com"); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
93:	return !TextUtils.isEmpty(editText.getText()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText, addTextChangedListener, setTextColor
66:	afterTextChanged(userInputField.getText()); 
-
68:	userInputField.addTextChangedListener(this); 
-
81:	userInputField.setTextColor(XMPPHelper.getEditTextColor(mMainWindow)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText
52:	selection.setText(edit.getText()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setSelection, getSelectionStart, setInputType, setText
244:	mText.setInputType(inputType); 
-
319:	int curSelectedPos = mText.getSelectionStart(); 
320:	int curTextLength = mText.getText().length(); 
-
322:	mText.setText(formatNumber(mCurrent)); 
-
325:	selectPos = mText.getText().length(); 
-
329:	mText.setText(mDisplayedValues[mCurrent - mStart]); 
330:	selectPos = mText.getText().length(); 
-
332:	mText.setSelection(selectPos); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
153:	String path = input.getText().toString(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: requestFocus
51:	EditText editText = new EditText(this); 
52:	editText.requestFocus(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addTextChangedListener, setImeOptions, setInputType, setText
61:	edit = new EditText(context); 
62:	edit.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL); 
63:	edit.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI); 
-
67:	edit.addTextChangedListener(new TextWatcher() { 
-
121:	edit.setText(Double.toString(value)); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
39:	String _lon=lon.getText().toString(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setText
104:	editor.setText(note); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
58:	return(editor.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
67:	shareIntent.putExtra(Intent.EXTRA_TEXT, editor.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
113:	String message = txtMessage.getText().toString(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
78:	i.putExtra(SCRIPT, script.getText().toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
110:	CharSequence newName = mNickname.getText(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
66:	passwordView.getText().toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
112:	Editable value = input.getText(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
16:	return ! TextUtils.isEmpty(et.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
17:	return TextUtils.isDigitsOnly(et.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
32:	mDescription = ParseUtils.parseString(mEditDescription.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
21:	return TextUtils.equals( et.getText(), "ciao" ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
120:	outState.putString(KEY_NAME, mDeviceNameView.getText().toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
26:	return pattern.matcher(et.getText()).matches(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
89:	outState.putString(EXTRA_SHORTCUT, mShortcutEditText.getText().toString()); 
Full Snippet Info
7
CodeRank
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

See Code Examples for Android EditText Methods: