add WakeLock#isHeld()
This commit is contained in:
parent
162389a7e0
commit
1417410dbb
1 changed files with 2 additions and 1 deletions
|
@ -206,7 +206,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (mWakeLock != null)
|
if (mWakeLock != null)
|
||||||
mWakeLock.release();
|
if (mWakeLock.isHeld())
|
||||||
|
mWakeLock.release();
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue