I have a service that listens for incoming data and I need to display the number. I’m using compose with a single activity tied to a viewModel. Does anyone know how to parse the data inside extra to extract “1234”? Then pass the data around so that it can be used in the UI? I need 1234 to show up on the UI with compose
Copy code
class DataReceiver : Service() {
//other service code
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
val extra = intent.extras?.getString("extra")
// extra = {1234,string1,string2}
return super.onStartCommand(intent, flags, startId)
}
}