I am receiving some data from Broadcast receiver to Activity through listeners. Now I need that data in my composable function which I have called from Activity.
class DashboardActivity : AppCompatActivity(),BarcodeScanningReceiver.BarcodeScanningReceiverInterface {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
AppTheme {
LoadItemRankScreen() //composable function
}
}
}
override fun barcodeData(data: String) {
// I need to pass this data param whenever it receives here
}}
Please help me to implement best approach how can I pass this data to composable function.
sharedViewModel
..