Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK
If you look around, people may suggest
Intent.FLAG_ACTIVITY_CLEAR_TOP
but this didn't do the job.
Intent.FLAG_ACTIVITY_CLEAR_TOP
but this didn't do the job.
public interface ImeBackListener { public abstract void onImeBack(SearchEditText ctrl, String text); }
public class SearchEditText extends EditText{ private ImeBackListener mOnImeBack; public SearchEditText(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub } @Override public boolean onKeyPreIme(int keycode, KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) if (mOnImeBack != null) mOnImeBack.onImeBack(this, this.getText().toString()); return super.dispatchKeyEvent(event); } public void setOnImeBackListener(ImeBackListener listener) { mOnImeBack = listener; } }