Skip to content

Commit

Permalink
Merge pull request #15 from yankeppey/fix/save-restore-class-cast-exc…
Browse files Browse the repository at this point in the history
…eption

Crash fix on Save/Restore state
  • Loading branch information
mabbas007 authored Sep 26, 2016
2 parents 5147a5e + 408a629 commit 59187a1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,11 @@ public void onRestoreInstanceState(Parcelable state) {
mIsSpacesAllowedInTags = bundle.getBoolean(ALLOW_SPACES_IN_TAGS, mIsSpacesAllowedInTags);

mLastString = bundle.getString(LAST_STRING);
Tag[] tags = (Tag[]) bundle.getParcelableArray(TAGS);

if (tags != null) {
Parcelable[] tagsParcelables = bundle.getParcelableArray(TAGS);
if (tagsParcelables != null) {
Tag[] tags = new Tag[tagsParcelables.length];
System.arraycopy(tagsParcelables, 0, tags, 0, tagsParcelables.length);
mTags = new ArrayList<>();
Collections.addAll(mTags, tags);
buildStringWithTags(mTags);
mTextWatcher.afterTextChanged(getText());
Expand Down

0 comments on commit 59187a1

Please sign in to comment.