I can’t find a way to obtain a reference the Window containing an arbitrary View v. I found getWindowToken, but I can’t figure out how to use it? Does anyone know how?
Also, does anyone know why it returns an IBinder rather than a Window?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well… since all views have a reference of the activity that created them (
Context), you can use thatContextto get a reference of the window. Let me show you this example I wrote some minutes ago:Then, inside your view you can do this:
In this case, I change the mode the Window is displayed to Fullscreen. Hope this help you. Tell me if you get in trouble with this.