Reason for error
getWindowManager()
is a method on Activity
not on an AsyncTask
so you will get the error "The method getWindowManager() is undefined for the type RequestTask.".
How to fix it?
In order to get this method inside AsyncTask use getSystemService()
to retrieve a WindowManager
then do you task.
See this documentation of WindowManager