-1
This problem may occur sometimes and as you are calling a method that is compatible with Appcompatactivity and is not going, the problem may be in the cache of android studio.
What you can do is the following:
Go to File > Invalidate Caches / Restart...> Invalidate and Restart.
This action solves many problems in Android Studio, it is the first that I use when I have similar problems.
getWindow() is a method of Activity, and its class us Appcompatactivity, not sure if it is compatible, maybe you need to take Activity or cast a
– Ricardo Pontual
Try to invalidate the cache and restart. Go to File > Invalidate Caches / Restart...> Invalidate and Restart. Calling the method within Activity was to be able to call the method.
– Murillo Comino
@Ricardopunctual is computable yes.
– Murillo Comino
Put as answer @Murillocomino my hero, was with this problem for days stagnant without doing anything, this problem was occurring with other commands and was torturing me LOVE YOU FUCKING
– inosivel
@I put as an answer, if I can mark it. I’m glad I helped! Hugs.
– Murillo Comino