TextView setOnEditorActionListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setOnEditorActionListener method.

This code example shows how to use the following methods:setLayoutParams, addTextChangedListener, setMaxLines, setMinLines, setOnEditorActionListener
		mContainer = ( LinearLayoutIMETrap ) new LinearLayoutIMETrap ( sContext );
		mContainer.setLayoutParams ( new LinearLayout.LayoutParams ( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT ));
		mContainer.setOrientation ( LinearLayout.VERTICAL );
		mContainer.setMainActivity ( activity );
 
		mKeyInTextView = new EditText ( activity );
 
		mKeyInTextView.setText ( "" );
		mKeyInTextView.setMinLines ( 1 );
		mKeyInTextView.setMaxLines ( 1 );
		 
		mKeyInTextView.addTextChangedListener ( new TextWatcher () {
 
			public void afterTextChanged ( Editable s ) {
 
   				mKeyString = s.toString ();
			} 
 
			public void beforeTextChanged ( CharSequence s, int start, int count, int after ) {
 

9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnKeyListener, getInputType, setOnEditorActionListener
   * @param runnable 
   * @return edit text 
   */ 
  public static EditText onDone(final EditText editText,
      final BooleanRunnable runnable) {
    if ((editText.getInputType() & TYPE_TEXT_FLAG_MULTI_LINE) == 0)
      editText.setOnKeyListener(new OnKeyListener() {
 
        public boolean onKey(View v, int keyCode, KeyEvent event) {
          if (keyCode != KEYCODE_ENTER)
            return false; 
          if (event == null)
            return false; 
          if (event.getAction() != ACTION_DOWN)
            return false; 
 
          return runnable.run();
        } 
      }); 
 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnKeyListener, getText, addTextChangedListener, setOnEditorActionListener
	private void updateEnablement() { 
		connect.setEnabled(loginEnabled());
	} 
 
	private boolean loginEnabled() { 
		return login.getText().length() > 0 && password.getText().length() > 0;
	} 
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getSupportActionBar().setDisplayShowTitleEnabled(false); 
		getSupportActionBar().setDisplayShowHomeEnabled(false); 
 
		UpdateUiTextWatcher watcher = new UpdateUiTextWatcher();
		login.addTextChangedListener(watcher);
		password.addTextChangedListener(watcher);
 
		signupLink.setMovementMethod(LinkMovementMethod.getInstance());
 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnEditorActionListener
		@Override 
		public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			View root = inflater.inflate(R.layout.signup_step_2, container, false);
			root.findViewById(R.id.btn_next).setOnClickListener(this);
			etHobby = (EditText) root.findViewById(R.id.et_hobby);
			etHobby.setOnEditorActionListener(new OnEditorActionListener() {
				@Override 
				public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
					if (actionId == EditorInfo.IME_ACTION_DONE) {
						next(); 
						return true; 
					} 
					return false; 
				} 
			}); 
 
			return root;
		} 
 
		@Override 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related TextView setOnEditorActionListener Questions & Answers:

setOnEditorActionListener Method Overview
Set a special listener to be called when an action is performed on the text view.
See Code Examples for other Android TextView Methods: