0

I have a dialog which I am using to input data into my app. I want to catch the event touch outside of my dialog. I want to check the value before the input is made to SQLite. How can I do this?

Here my code, but it did not run

public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
            Toast.makeText(getApplicationContext(), "Finish", 3000).show();
            finish();               
            return true;
        }
        return false;
    }
Thị Duyên
  • 61
  • 1
  • 6

0 Answers0