I need to use a wakelock to hold the screen active while its required.
I was recommended to use a service which I have been trying but on the
onDestroy I am getting "wl cannot be resolved". Code below:
public class WakeLockService extends Service {
@Override
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onCreate() {
PowerManager pm = (PowerManager) getSystemService
(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock
(PowerManager.FULL_WAKE_LOCK, "My Tag");
wl.acquire();
}
public void onDestroy() {
wl.release();
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---