Inside your onReceive() method in your BroadcastReceiver class, you want to show different Toast messages for different Intent actions. Reorder the lines of codes to achieve this goal.
Handle the case of AIRPLANE_MODE_CHANGED first!
Inside your onReceive() method in your BroadcastReceiver class, you want to show different Toast messages for different Intent actions. Reorder the lines of codes to achieve this goal.
Handle the case of AIRPLANE_MODE_CHANGED first!
}
Toast.makeText(context, "The date was changed", LENGTH_LONG).show()
Toast.makeText(context, "Airplane mode was changed", LENGTH_LONG).show()
Intent.ACTION_DATE_CHANGED ->
when (intent.action) {
Intent.ACTION_AIRPLANE_MODE_CHANGED ->
Create a free account to access the full topic