Closed alashow closed 8 years ago
Although I am not able to produce this exception on my end [API 22, Nexus 4], I may have located the problem.
SublimeMenu
implements Parcelable
and provides the CREATOR
:
public static final Creator CREATOR = new Creator() {
public SublimeMenu createFromParcel(Parcel in) {
return new SublimeMenu(in);
}
public SublimeMenu[] newArray(int size) {
return new SublimeMenu[size];
}
};
The constructor Sublime(Parcel)
:
public SublimeMenu(Parcel in) {
readParcel(in);
}
private void readParcel(Parcel in) {
mMenuResourceID = in.readInt();
// Exception if `mItems` is null here
in.readTypedList(mItems, SublimeBaseMenuItem.CREATOR);
for (SublimeBaseMenuItem item : mItems) {
item.setParentMenu(this);
}
// Exception if `mGroups` is null here
in.readTypedList(mGroups, SublimeGroup.CREATOR);
for (SublimeGroup group : mGroups) {
group.setParentMenu(this);
}
}
This is good if mItems
& mGroups
are initialized. The exception gets thrown if they are null
.
As a fix, I am initializing mitems
& mGroups
outside the constructor now. I will push this along the next update.
I am closing this for now. We'll revisit this if the problem persists after the update.
could you please push it as snapshot or something like that. thanks.
I have pushed this on the dev
branch. You can access it using Jitpack:
In your project's build.gradle
:
allprojects {
repositories {
jcenter()
....
....
maven { url "https://jitpack.io" }
}
}
In your app's build.gradle
:
dependencies {
....
....
compile 'com.github.vikramkakkar:SublimeNavigationView:dev-SNAPSHOT'
}
Thanks for pointing this out!
Crashes sometimes with following exception: