add WakeLock#isHeld()

This commit is contained in:
Milos Kozak 2017-08-27 11:53:36 +02:00
parent 162389a7e0
commit 1417410dbb

View file

@ -206,7 +206,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
@Override
public void onDestroy() {
if (mWakeLock != null)
mWakeLock.release();
if (mWakeLock.isHeld())
mWakeLock.release();
super.onDestroy();
}