Open ShridharMe-Kore opened 3 years ago
I've narrowed down that in the Java code, the Intent is coming through as null. Thus "getAction()" or "getType()" fail. I tried revising the AndroidManifest to make sure the intent if being passed through properly, but that didn't help. Also tried modifying the Java code with the PR above (#42), but that didn't work either.
The issue is in this code block:
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@ReactMethod
public void getFileNames(Promise promise){
Activity mActivity = getCurrentActivity();
if(mActivity == null) { return; }
Intent intent = mActivity.getIntent();
receiveSharingIntentHelper.sendFileNames(reactContext, intent, promise);
mActivity.setIntent(null);
}
Any ideas?
I have the same problem. Any solution?
same
Same here, it seems for the initial call there is no intent object, so you can check if it´s not null.
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@ReactMethod
public void getFileNames(Promise promise){
Activity mActivity = getCurrentActivity();
if(mActivity == null) { return; }
Intent intent = mActivity.getIntent();
if(intent == null) { return; }
receiveSharingIntentHelper.sendFileNames(reactContext, intent, promise);
mActivity.setIntent(null);
}
[Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getAction()' on a null object reference] share ext error