1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-12-13 19:58:07 +00:00

Fix deprecation of Bundle.getSerializable(String) by using BundleCompat

This fixes the following warning during compilation:

file:app/src/main/java/org/schabi/newpipe/about/LicenseFragment.kt:36:55 'fun getSerializable(p0: String?): Serializable?' is deprecated. Deprecated in Java.
This commit is contained in:
TobiGr
2025-12-10 14:40:16 +01:00
parent 3d1d7e0870
commit 7ffc513f46

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() {