Code example for EditText

Methods: setOnEditorActionListener

0
		@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