fix: android 13 crash with parcelable extras
[internal android bug!] Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
7cfbc3fdac
commit
c39a209295
|
|
@ -96,7 +96,8 @@ class ShareTargetActivity : ComponentActivity() {
|
|||
else -> {
|
||||
listOf(
|
||||
when {
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> {
|
||||
// due to a bug in Android 13 we still use the deprecated method on Android 13, despite the new method being available
|
||||
Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU -> {
|
||||
intent.getParcelableExtra(
|
||||
Intent.EXTRA_STREAM,
|
||||
Parcelable::class.java
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@ class ImageViewActivity : ComponentActivity() {
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val autumnResource = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
// due to a bug in Android 13 we still use the deprecated method on Android 13, despite the new method being available
|
||||
val autumnResource = if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
|
||||
intent.getParcelableExtra("autumnResource", AutumnResource::class.java)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
|
|
|
|||
|
|
@ -35,12 +35,14 @@ class VideoViewActivity : FragmentActivity() {
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val autumnResource = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
intent.getParcelableExtra("autumnResource", AutumnResource::class.java)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
intent.getParcelableExtra("autumnResource")
|
||||
}
|
||||
val autumnResource =
|
||||
// due to a bug in Android 13 we still use the deprecated method on Android 13, despite the new method being available
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) {
|
||||
intent.getParcelableExtra("autumnResource", AutumnResource::class.java)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
intent.getParcelableExtra("autumnResource")
|
||||
}
|
||||
|
||||
if (autumnResource?.id == null) {
|
||||
Log.e("VideoViewActivity", "No AutumnResource provided")
|
||||
|
|
|
|||
Loading…
Reference in New Issue