You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
if ((Intent.ACTION_SEND.equals(action) || Intent.ACTION_VIEW.equals(action)) && type != null) {
...
In readItemAt:
from
Uri uri = null;
if (intent.getClipData() != null && intent.getClipData().getItemAt(index) != null)
uri = intent.getClipData().getItemAt(index).getUri();
String url = null;
to
Uri uri = null;
String url = null;
if (intent.getClipData() != null && intent.getClipData().getItemAt(index) != null)
uri = intent.getClipData().getItemAt(index).getUri();
else if (intent.getData() != null) {
Uri copyfileUri = copyfile(intent.getData());
url = (copyfileUri != null) ? copyfileUri.toString() : null;
}
I also modified readFileName() to avoid some possible errors:
Hello @armandn, thanks for sharing this! This was requested in 87. We'll have to see if your code changes interfere with the "normal" share functionality. But if not, we could include this as an addition to the project. If you find time, please create a pull request for this!
I managed to register my app as the default handler for a file type (mime type) and I think the plugin could be modified/extended to do this as well.
Note that in my tests I did not register a separate activity, I used MainActivity. it seems to work fine, although I'll have to do more tests.
In AndroidManifest.xml:
I then modified SendIntent.java:
In
checkSendIntentReceived
:In
readItemAt
:from
to
I also modified
readFileName()
to avoid some possible errors:Finally, I also have this in MainActivity.java:
I am pretty new at Android so I'm not entirely sure the code is correct and doesn't introduce other unwanted behavior.
The text was updated successfully, but these errors were encountered: