当前位置:操作系统 > 安卓/Android >>

Android 点亮屏幕

	private void AcquireWakeLock() {
		PowerManager pm = (PowerManager)mApplicationContext.getSystemService(Context.POWER_SERVICE);
		
		WakeLock m_wakeObj = (WakeLock)pm.newWakeLock(PowerManager.FULL_WAKE_LOCK
                | PowerManager.ACQUIRE_CAUSES_WAKEUP
                | PowerManager.ON_AFTER_RELEASE, "");
		
		// m_wakeObj.acquire();
		
		//点亮屏幕15秒钟
		m_wakeObj.acquire(1000 * 5);
		m_wakeObj.release();//释放资源
		
	}

 

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,