I've looked up how to receive content from an app when it wants to share something. This usually involves "Intent Filters". For my app, I want it to be able to accept pictures, and then launch the app and save the picture to memory when it's launched (via the share).
How do I go about doing this? Explanations I've seen involve adding something resembling the following to my Manifest file:
My app doesn't show up in the stock Gallery's share function with this. How can I make it work, and how can I reference what to do when the app is launched this way? There's nice documentation on this for Android, but not for Basic4Android.
Dim UriString as String
UriString = In.GetExtra("android.intent.extra.STREAM")
' Now UriString should contain a value similar to content://media/external/images/media/7859
'And now you can call the function to get the filepath
Preview.SetBackgroundImage(LoadBitmap("", GetPathFromContentResult(UriString)))
Error occurred:
An error has occured in sub:
main_getpathfromcontentresult
(java line: 415)
java.lang.RuntimeException:
Object should first be initialized (Cursor).
Continue?
The intent returned on my device, had another extra after this one, so it had a comma.
So you have to careful otherwise your code will not run on all devices (my code was only a demonstration not meant to be used in production-grade code).
Either way, the correct way is to use In.GetExtra which is not working for some reason.
The intent returned on my device, had another extra after this one, so it had a comma.
So you have to careful otherwise your code will not run on all devices (my code was only a demonstration not meant to be used in production-grade code).
Either way, the correct way is to use In.GetExtra which is not working for some reason.