Code example for PowerManager

Methods: isScreenOn

0
	@Override 
	public FREObject call(FREContext $content, FREObject[] $args)
	{ 
		_context = $content;
		PowerManager __pm = (PowerManager) _context.getActivity().getSystemService(Context.POWER_SERVICE);
		boolean __isScreenOn = __pm.isScreenOn();
		try 
		{ 
			FREObject __obj = FREObject.newObject(__isScreenOn);
			Log.i(TAG, "IsScreenOn:"+__isScreenOn);
			return __obj;
		}  
		catch (FREWrongThreadException $e)
		{ 
			$e.printStackTrace();
			_context.dispatchStatusEventAsync($e.getMessage(), TAG);
		} 
		return null; 
	} 
} 
Experience pair programming with AI  Get Codota for Java