Archana
Archana

Reputation: 11

Wakeup lock is not working in android mobile app

My wakeup lock is not working in android. I have used below code:-

PowerManager powerManager = (PowerManager) this.getSystemService(POWER_SERVICE);
PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
               "MyApp::MyWakelockTag");
wakeLock.acquire(IDLE_DELAY_MINUTES+1000); 

In the manifest file I have also mentioned:-

<uses-permission android:name="android.permission.WAKE_LOCK" />

What is wrong in my code?

Upvotes: 0

Views: 70

Answers (0)

Related Questions