Kotlin Android: How to pass ArrayList of Serializable objects through intent without unchecked cast warning?
I'm creating an Intent like so:
public void showThings(ArrayList things) {
Intent intent = new Intent(this, ThingActivity.class);
intent.putExtra(THINGS, things);
startActivity(intent);
}
Then in the ThingActivity I want to get the ArrayList
class ThingActivity {
var things: ArrayList? = null
override fun onCreate(savedInstanceState: Bundle?) {
things = intent.extras.getSerializable(OtherActivity.THINGS) as? ArrayList
}
Unfortunately, I can't seem to figure...