I have created an android native module and trying to call some method of this module after bridging with react native module.
RN World:
NativeModle.ModuleName.someMethod()
Android world:
@ReactMethod
fun someMethod(){
context.startActivity(new Intent(MainActivity.class,context));
}
But in my android native module i have a CustomApplication class which provide necessary things to function other class like some FileProvider , SharedPreferenceProvide etc. While calling Mainactivity the code in Mainactivity also requires some things from CustomApplication class . But as the android native module is a library module (application tag is neglected in library module) I am not able to provide some things to Mainactivity class causing NullPointerException.
Solution could be: Not keeping any application class and provide it through some other manner . But I have no much idea about library development . Suggest me the best idea to achieve this scenario.