草庐IT

getCurrentActivity

全部标签

java - 尝试向 React Native 添加 openFile 方法,无法调用 getCurrentActivity

在react-native-fs(https://github.com/johanneslumpe/react-native-fs)的一个分支中,我试图添加这段代码:publicclassRNFSManagerextendsReactContextBaseJavaModule{publicRNFSManager(ReactApplicationContextreactContext){super(reactContext);}@ReactMethodpublicvoidopenFile(Stringfilepath,Callbackcallback){try{Filefile=newF

android - getCurrentActivity 不是公开的 'com.facebook.react.bridge.React Context` 无法从外部包访问

我正在尝试构建react-native需要通过Activity的模块一些方法privateReactApplicationContextreactContext;...@ReactMethodpublicvoidsendVerificationCode(StringphoneNumber){PhoneAuthProvider.getInstance().verifyPhoneNumber(phoneNumber,//Phonenumbertoverify60,//TimeoutdurationTimeUnit.SECONDS,//UnitoftimeoutreactContext.ge