Skip to content

Commit de6dc02

Browse files
authored
Merge pull request TeamNewPipe#12885 from TobiGr/fix/serializable
Fix deprecation of Bundle.getSerializable(String) by using BundleCompat
2 parents 3d1d7e0 + 7ffc513 commit de6dc02

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/org/schabi/newpipe/about/LicenseFragment.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.view.View
77
import android.view.ViewGroup
88
import android.webkit.WebView
99
import androidx.appcompat.app.AlertDialog
10+
import androidx.core.os.BundleCompat
1011
import androidx.core.os.bundleOf
1112
import androidx.fragment.app.Fragment
1213
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
@@ -33,7 +34,9 @@ class LicenseFragment : Fragment() {
3334
super.onCreate(savedInstanceState)
3435
softwareComponents = arguments?.parcelableArrayList<SoftwareComponent>(ARG_COMPONENTS)!!
3536
.sortedBy { it.name } // Sort components by name
36-
activeSoftwareComponent = savedInstanceState?.getSerializable(SOFTWARE_COMPONENT_KEY) as? SoftwareComponent
37+
activeSoftwareComponent = savedInstanceState?.let {
38+
BundleCompat.getSerializable(it, SOFTWARE_COMPONENT_KEY, SoftwareComponent::class.java)
39+
}
3740
}
3841

3942
override fun onDestroy() {

0 commit comments

Comments
 (0)