The getWindow () method cannot use

I created a lockscreen for ics, which will replace the default screen lock. In my code, I want to use a method getWindow()to set "android:hardwareAccelerated"true to increase efficiency.

I have no activity in LockScreen.java . Therefore, I can not use activity.getWindow(). I also tried using context.getWindow()and this.getWindow(). But still he shows an error. How to use a method getWindow()to get a Window object?

+5
source share
1 answer

I think this is just a method that you can call an Activity or a class that extends it, because it belongs to it .: S So, either you need to be in action, or you need to pass this activity somehow. and I don’t understand how you have no activity! You will need to have in this case ...

LockScreen extends some classes, no? Which one?

+1
source

All Articles