Context
In PR #433 (feat/demo-edit-existing-posts), the new PostsListActivity uses the two-argument getParcelableExtra(String, Class) API without a version guard.
Bug
In PostsListActivity.onCreate(), two calls use the API 33+ form:
val postType = intent.getParcelableExtra(EXTRA_POST_TYPE, PostTypeDetails::class.java)
val configuration = intent.getParcelableExtra(MainActivity.EXTRA_CONFIGURATION, EditorConfiguration::class.java)
The two-argument Intent.getParcelableExtra(String, Class<T>) overload was added in API 33 (TIRAMISU). The project's minSdk is 24. On any device running API 24–32, this will crash with NoSuchMethodError.
EditorActivity already has the correct version-branched pattern:
val configuration =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
intent.getParcelableExtra(MainActivity.EXTRA_CONFIGURATION, EditorConfiguration::class.java)
} else {
@Suppress("DEPRECATION")
intent.getParcelableExtra<EditorConfiguration>(MainActivity.EXTRA_CONFIGURATION)
}
No desugaring or AndroidX IntentCompat is present in the project to mitigate this.
Impact
The app will crash immediately when navigating to the posts list on any device running Android 12L (API 32) or below — covering every API level from 24 through 32.
Fix
Apply the same Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU branching pattern used in EditorActivity to both getParcelableExtra calls in PostsListActivity.
Context
In PR #433 (
feat/demo-edit-existing-posts), the newPostsListActivityuses the two-argumentgetParcelableExtra(String, Class)API without a version guard.Bug
In
PostsListActivity.onCreate(), two calls use the API 33+ form:The two-argument
Intent.getParcelableExtra(String, Class<T>)overload was added in API 33 (TIRAMISU). The project'sminSdkis 24. On any device running API 24–32, this will crash withNoSuchMethodError.EditorActivityalready has the correct version-branched pattern:No desugaring or AndroidX
IntentCompatis present in the project to mitigate this.Impact
The app will crash immediately when navigating to the posts list on any device running Android 12L (API 32) or below — covering every API level from 24 through 32.
Fix
Apply the same
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISUbranching pattern used inEditorActivityto bothgetParcelableExtracalls inPostsListActivity.