Pozvat aplikaci s instagram

Příklady kódu

0
0

pozvat aplikaci s instagram

fun shareWithInstagram(context: Context) {
    try {
   		//val file: Uri = Uri.parse("android.resource://your.pacakage/" + R.mipmap.ic_logo)
        val shareIntent = Intent(Intent.ACTION_SEND)
        //shareIntent.type = "image/*"
        shareIntent.type = "text/plain"
        shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
        //shareIntent.putExtra(Intent.EXTRA_STREAM, file)
        //invite content is like combination of url and decreption
        shareIntent.putExtra(Intent.EXTRA_TEXT, INVITE_CONTENT)
        shareIntent.setPackage("com.instagram.android")
        context.startActivity(shareIntent)
    }
    catch (e: Exception) {
        //app not installed
        context.toast("Instagram App is not installed")
        //go with share sheet
        shareWithOtherApps(context)
    }
}

Související stránky

Související stránky s příklady

V jiných jazycích

Tato stránka je v jiných jazycích

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................