Code example for PowerManager

Methods: goToSleep

0
		 
		return true; 
	} 
 
	public void goToSleep(long time) {
		mPowerManager.goToSleep(time);
	} 
	 
	public PowerManager.WakeLock newWakeLock(int flags, String tag) {
		return mPowerManager.newWakeLock(flags, tag);
	} 
	 
	public void reboot(String reason) throws NoSuchMethodException, IllegalAccessException, IOException {
		Method m = PowerManager.class.getMethod("reboot", new Class[] { String.class } );
		try { 
			m.invoke(mPowerManager, new Object[] { reason });
		} 
		catch( InvocationTargetException e ) {
			Log.e(TAG, "InvactionTargetException caught when invoking reboot()");
			Throwable cause = e.getCause();
Stop searching for code, let great code find you!  Add Codota to your java IDE