Android EditText - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android EditText class.

This code example shows how to use the following methods: getText
	@Inject 
	GreetingService greetingService;
	 
	@Click 
	void button() { 
		String name = edit.getText().toString();
		greetingService.greet(name);
	} 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getText
        final EditText password = editText(id.et_password);
        focus(login);
        send("loginname"); 
        assertEquals("loginname", login.getText().toString());
        assertFalse(loginMenu.isEnabled());
        focus(password);
        send("password"); 
        assertEquals("password", password.getText().toString());
        assertTrue(loginMenu.isEnabled());
    } 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getText
    } 
 
 
    @Click 
    void myButtonClicked() { 
        String name = myEditText.getText().toString();
        setProgressBarIndeterminateVisibility(true);
        someBackgroundWork(name, 5);
    } 
 
    @Background 
    void someBackgroundWork(String name, long timeToDoSomeLongComputation) {
        try { 
            TimeUnit.SECONDS.sleep(timeToDoSomeLongComputation);
        } catch (InterruptedException e) {
        } 
 
        String message = String.format(helloFormat, name);
 
        updateUi(message, androidColor);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setEnabled, setInputType, setMaxHeight, setText
	} 
	 
	public InputDialog( String title, String message, String text, boolean editable, boolean password, Activity activity, InputDialogListener inputDialogListener ){
		super( activity );
		 
		mEditText = new EditText( activity );
		 
		if( text != null )
			mEditText.setText(text);
		 
		mEditText.setEnabled( editable );
		mEditText.setMaxHeight( 250 );
		 
		if( password )
			mEditText.setInputType( InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD );
				 
		this.setTitle( title );
		this.setMessage( message );
		this.setView( mEditText );
		 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setSelection, getSelectionEnd, getSelectionStart, setTransformationMethod
    toggleShowPassphrase(passphrase, isChecked);
    toggleShowPassphrase(confirm, isChecked);
  } 
 
  private void toggleShowPassphrase(EditText field, boolean isChecked) {
    int start=field.getSelectionStart();
    int end=field.getSelectionEnd();
 
    if (isChecked) {
      field.setTransformationMethod(null);
    } 
    else { 
      field.setTransformationMethod(new PasswordTransformationMethod());
    } 
 
    field.setSelection(start, end);
  } 
 
  @Override 
  public void onClick(View v) {
    v.setEnabled(false);
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

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: