Runtimeexception: Parcel Android.os.parcel: Unmarshalling Unknown Type Code When Using Android Bundle
I am getting the below error message: java.lang.RuntimeException: Parcel android.os.Parcel@41141190: Unmarshalling unknown type code 7602286 at offset 16 at android.os.Parcel.readV
Solution 1:
After spending lots of hour i found solution, that i made mistake in Parcelable class, i forgot to write and read one of the parameters, finally i solved issue, my code look like:
publicvoidwriteToParcel(Parcel dest, int flags){
dest.writeString(filepath);
dest.writeString(filename);
dest.writeString(fileCount);
dest.writeInt(index);
}
publicYourParcelableClassName(Parcel in){
filepath = in.readString();
filename = in.readString();
fileCount = in.readString();
index = in.readInt();
}
in the first activity pass data,
Intent mIntent = newIntent(YourFirstActivity.this,YourSecondActivity.class);
mIntent.putExtra("position",position);
mIntent.putParcelableArrayListExtra("filedata",parcelableArrayList);
startActivity(mIntent);
for getting intent data into second activity,
int Position = getIntent().getIntExtra("position",0);
parcelableArrayList = getIntent().getParcelableArrayListExtra("filedata");
Post a Comment for "Runtimeexception: Parcel Android.os.parcel: Unmarshalling Unknown Type Code When Using Android Bundle"