Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getWindow() method not able to use

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

I don't have any activity in the LockScreen.java. So I am not able to use activity.getWindow(). I tried with context.getWindow() and this.getWindow() also. But still it shows error. How to use getWindow() method to get the Window object?

like image 315
Kamalone Avatar asked Nov 13 '22 08:11

Kamalone


1 Answers

I think this is simply method you can call on Activity or class that extend it, because it belongs to it.. :S So either you need to be in activity or you need to pass that activity somehow. and I don't get it how you don't have any Activity?! You would need to have some in this case...

LockScreen is extending some class, no? Which one?

like image 74
Ewoks Avatar answered Nov 16 '22 03:11

Ewoks