A little code to share an image to instagram using an intent. Hope it's usefull
if you want to Twitter just change:
B4X:
Dim u As Uri 'ContentResolver library
u.Parse("file://" & File.Combine(a, "tmpfile.jpg"))
Dim inten As Intent
Dim tmpt As String = "your text"
inten.Initialize(inten.ACTION_SEND,"")
inten.SetType("image/*")
inten.PutExtra("android.intent.extra.STREAM",u)
inten.PutExtra("android.intent.extra.TEXT",tmpt)
inten.SetComponent("com.instagram.android/.activity.ShareHandlerActivity")
StartActivity(inten)
if you want to Twitter just change:
B4X:
inten.SetComponent("com.twitter.android/.composer.ComposerActivity")
Last edited: