Activity cannot be converted to LifecycleOwner
You don't need to use
mLifecycleRegistry = new LifecycleRegistry(this);
mLifecycleRegistry.markState(Lifecycle.State.CREATED);
Since, new AppcompatActivity
is already lifecyclerOwner
.
You also observe class object, which is incorrect. actMain.class
is a class object.
You should have:
alarmViewModel.getAlarmList().observe(this, new Observer<List<Alarm>>() {
@Override
public void onChanged(@Nullable List<Alarm> alarms) {}
});