Add support for sharing text from other app

This commit is contained in:
Moez Bhatti
2018-01-06 02:54:05 -05:00
parent 0709c96656
commit e003734f1d
3 changed files with 13 additions and 2 deletions
@@ -62,7 +62,7 @@ class Navigator @Inject constructor(val context: Context) {
fun showCompose(body: String? = null) {
val intent = Intent(context, ComposeActivity::class.java)
intent.putExtra("body", body)
intent.putExtra(Intent.EXTRA_TEXT, body)
startActivity(intent)
}
@@ -70,7 +70,8 @@ class ComposeViewModel(intent: Intent) : QkViewModel<ComposeView, ComposeState>(
init {
appComponent.inject(this)
draft = intent.extras?.getString("body") ?: ""
draft = intent.extras?.getString(Intent.EXTRA_TEXT) ?: ""
intent.clipData
val threadId = intent.extras?.getLong("threadId") ?: 0L
var address = ""