Skip to content

About

Using ShareSheet and Intent Resolver in Android to share the data from one app to another

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

SharingJetPackComponent

Impleentation of ShareSheet and Intent Resolver in Android.

fun ClickedShareSheet(){ val intent = Intent().apply { action = Intent.ACTION_SEND putExtra(Intent.EXTRA_TEXT, editTextMessage.getText().toString()) type = "text/plain" } val pi = PendingIntent.getBroadcast( applicationContext, 100, Intent(applicationContext, MyBroadcastReceiver::class.java), PendingIntent.FLAG_UPDATE_CURRENT ) val share = Intent.createChooser(intent, null, pi.intentSender) startActivity(share) } // This function is use for share content by using ShareSheet.

fun ClickedbyIntentResolver(){
    val sendIntent: Intent = Intent().apply {
        action = Intent.ACTION_SEND
        putExtra(Intent.EXTRA_TEXT, editTextMessage.getText().toString())
        type = "text/plain"
    }
    startActivity(sendIntent)
}// This function is use for share content by using Intent Resolver(No need of createChooser).

MainActivity.kt class is used for sharing the content.

Receiver.kt is used for receiving the content.

About

Using ShareSheet and Intent Resolver in Android to share the data from one app to another

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages