B4A Class Custom Share Intent

Discussion in 'Additional libraries, classes and official updates' started by Emme Developer, Jan 9, 2018.

  1. Emme Developer

    Emme Developer Well-Known Member Licensed User

    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

    Code:
    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
     

    Attached Files:

    fredo, JohnC, Multiverse app and 4 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice