I have a Parcelable data class object I want to pass from one Activity to another via an Intent
intent.putExtra("barcodeListItem", listItem)
Before API level 33, retrieving this class object was no problem until seemingly everything under the sun (function wise) for the Intent class has became deprecated. Like the below line of code.
val listItem = intent.getParcelableExtra<BarcodeListItem>("barcodeListItem")
I’ve tried everything I can think of, like using a Bundle instead
var bundle = Bundle();
bundle.putParcelable("barcodeListItem1",listItem);
intent.putExtras(bundle);
I can get the bundle in the receiving Activity, but can’t figure out how to extract the class object. Because similar to Intent, everything I’ve tried using Bundle to get the class object is also deprecated. The get method ( along with a host of other methods) has become deprecated.
val bundle = intent.extras
val listObject = bundle?.get("barcodeListItem1")