1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-30 02:31:24 +00:00

Merge pull request #12885 from TobiGr/fix/serializable

Fix deprecation of Bundle.getSerializable(String) by using BundleCompat
This commit is contained in:
Aayush Gupta
2025-12-13 16:04:08 +08:00
committed by GitHub

View File

@@ -7,6 +7,7 @@ import android.view.View
import android.view.ViewGroup
import android.webkit.WebView
import androidx.appcompat.app.AlertDialog
import androidx.core.os.BundleCompat
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
@@ -33,7 +34,9 @@ class LicenseFragment : Fragment() {
super.onCreate(savedInstanceState)
softwareComponents = arguments?.parcelableArrayList<SoftwareComponent>(ARG_COMPONENTS)!!
.sortedBy { it.name } // Sort components by name
activeSoftwareComponent = savedInstanceState?.getSerializable(SOFTWARE_COMPONENT_KEY) as? SoftwareComponent
activeSoftwareComponent = savedInstanceState?.let {
BundleCompat.getSerializable(it, SOFTWARE_COMPONENT_KEY, SoftwareComponent::class.java)
}
}
override fun onDestroy() {