B4A Class Custom Share Intent

Hi everybody!
I created this small class as is not simple to handle the click event on a IntentChooser
Code is pretty simple and entirely customizable. I was ispired to Samsung Share Intent, i don't know if it is the same on all Android Version

B4X:
Sub MakeIntent
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
in.PutExtra("android.intent.extra.TEXT","Share share share the text")
in.SetType("text/plain")

Dim Share As CustomShare
Share.Initialize(Activity,in)
Share.SetEvent(Me,"Share")
Share.Title = "Share content.."
End Sub

Sub Share_OnCancel
Log("Cancel click")
End Sub

Sub Share_ApplicationChose (component As String, inte As Intent)
inte.SetComponent(component)
StartActivity(inte)
End Sub
 

Attachments

  • CustomShare.bas
    5.5 KB · Views: 180
Top