Skip to content

AndroidX Core bundleOf is Deprecated, replace it. #147

@mmathieum

Description

@mmathieum

androidx.core.os.bundleOf if deprecated

Deprecated the bundleOf(...) extension function, which does not provide compile time type safety and may lead to crashes at run time. Instead, use Bundle methods directly. (I48af2, b/434825212)

bundleOf code:
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:core/core-ktx/src/main/java/androidx/core/os/Bundle.kt

-> all androidx.core.os.bundleOf import should be removed

Example:

  • before:
bundleOf(
    "key1" to "value1",
    "key2" to 2,
    "key3" to true,
)
  • after:
Bundle().apply {
    putCharSequence("key1", "value1")
    putInt("key2", 2)
    putBoolean("key3", true)
}

Needed for:

Metadata

Metadata

Labels

AIMade by/with AI (Gemini/Copilot)P4🔽 Priority 4: LowcleanupdependenciesPull requests that update a dependency file

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions