0

I have a view declared as such:

LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
myView = layoutInflater.inflate(R.layout.background, null);

I want to detect clicks outside of myView, how can I do this?

So this background.xml is a small relativelayout that pops up when the user clicks on a button. It has an edit text so I do this to gain focus to it and allow to type on it:

response.setFocusable(true);
params.flags = params.flags & ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
mWindowManager.updateViewLayout(myView, params);

Now if the user clicks outside this pop up(background.xml aka myView) I want to set the param.flags back to FLAG.NOT_FOCUSABLE

user2779837
  • 301
  • 3
  • 15

1 Answers1

0

You can create a dummy view and make it fill parent and add onClickListener and do what you want on onClick.

RussVirtuoso
  • 900
  • 1
  • 9
  • 20