I'm attempting to bridge over the Android functionality of keeping the screen on to React Native. I figured I could do this with a simple module, however I don't know how to get access to the current Android Activity from said module.
I need the Activity reference so I can call .getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
on it
I tried to get the activity via casting like so ((Activity)getReactApplicationContext().getBaseContext())
, but this throws a "cannot be cast to Android.app.Activity" error