How to access Activity from a React Native Android module?

前端 未结 9 716
星月不相逢
星月不相逢 2020-12-04 21:53

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

9条回答
  •  粉色の甜心
    2020-12-04 22:26

    For custom UI component, you can get the context in the constructor, and later you can get the activity by context.getCurrentActivity()

提交回复
热议问题