Private Sub GetUrisFromStartingIntent(in As Intent) As List
Log(in.Action)
Log(in.GetData)
Log(in.ExtrasToString)
Dim ImageList As List
ImageList.Initialize
If in.IsInitialized And in <> OldIntent Then
If in.Action = "android.intent.action.SEND" Or in.Action= "android.intent.action.SEND_MULTIPLE" Then
ImageList= GetImageUrisFromExtras(in.ExtrasToString, in.action)
End If
OldIntent = in
End If
Return ImageList
End Sub
Sub GetImageUrisFromExtras (Extras As String, Intent As String) As List
Log(Extras)
Dim ImageList As List
ImageList.Initialize
Dim JO As JavaObject = Activity.GetStartingIntent
Select Intent
Case "android.intent.action.SEND"
Dim uri As String = JO.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM"))
ImageList.Add(uri)
Case "android.intent.action.SEND_MULTIPLE"
Dim uris As List = JO.RunMethod("getParcelableArrayListExtra", Array("android.intent.extra.STREAM"))
If uris.Size > 0 Then
For i = 0 To uris.Size-1
ImageList.Add(uris.Get(i))
Next
End If
End Select
Return ImageList
End Sub