Code example for Handler.Callback

Methods: handleMessage

0
	@Override 
	public boolean onKey(View v, int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_ENTER) {
			final Message msg = new Message();
			msg.obj = this.pass.getText().toString();
			this.callback.handleMessage(msg);
			dismiss();
			return true; 
		} 
		return false; 
	} 
	@Override 
	public void onCancel(DialogInterface dialog) {
		this.callback.handleMessage(new Message());
	} 
}