mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 23:00:31 +05:30
26 lines
688 B
Kotlin
26 lines
688 B
Kotlin
|
package com.github.libretube
|
||
|
|
||
|
import android.content.Intent
|
||
|
import android.os.Bundle
|
||
|
import android.util.Log
|
||
|
import androidx.appcompat.app.AppCompatActivity
|
||
|
|
||
|
class RouterActivity : AppCompatActivity() {
|
||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||
|
super.onCreate(savedInstanceState)
|
||
|
when (intent?.action) {
|
||
|
Intent.ACTION_SEND -> {
|
||
|
if ("text/plain" == intent.type) {
|
||
|
handleSendText(intent) // Handle text being sent
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private fun handleSendText(intent: Intent) {
|
||
|
intent.getStringExtra(Intent.EXTRA_TEXT)?.let {
|
||
|
Log.i(it,it)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|