How to save the data of recyclerview LiveData<List<SportData>> to avoid the loss of bottom navigation data?

Solution 1:

Your data is already at ViewModel. You don't need to save it. Since data in your viewModel and viewModel lives while your aplication lives, you'll not lose it.

What might be happening is a reload when you go back to your list's fragment, right?

You are calling a viewModel method from your fragment. This method does the request.

What you need to do is to make sure your fragment won't call it if it doesn't need.

What you need to do is:

if (savedBundleState == null) { //Read this as android creating this frag for the very first time
     //Here you call viewmodel method that does the request.
}

This is part 1

Since you are using Navigation Component, you'll need to setup it to avoid new fragments killing older fragments.