0

In my activity#1 I create my viewModel like this:

val viewViewModelProvider = ViewModelProviders.of(this) 
bluetoothPageViewModel = viewViewModelProvider.get(BluetoothPageViewModel::class.java)

Nice it's work fine. But I need when forward to another activity (activity#2) to destroy or clear all data in bluetoothPageViewModel.Because when I return (press back button) to activity#1 I need all data in bluetoothPageViewModel to be in init values.

Is it possible.

Alexei
  • 14,350
  • 37
  • 121
  • 240

0 Answers0