Code example for ImageButton

Methods: performClick

0
		messageEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
			@Override 
			public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
				if (actionId == EditorInfo.IME_ACTION_SEND) {
					if (v.getText().length() > 0)
						sendBtn.performClick();
					return true; 
				} 
				 
				return false; 
			} 
		}); 
		 
		sendBtn.setEnabled(false);
		sendBtn.setOnClickListener(new View.OnClickListener() {
			@Override 
			public void onClick(View v) {
				if (onSendMessageListener != null) {
					onSendMessageListener.onSendMessage(messageEditText.getText().toString());
					 
Contextual code suggestions in your IDE  Get Codota for Java