Skip to content

Commit

Permalink
Additional protections for JakeWharton#557.
Browse files Browse the repository at this point in the history
  • Loading branch information
Digipom committed Mar 15, 2013
1 parent b3470b2 commit 9c7de5a
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ protected void onAttachedToWindow() {
super.onAttachedToWindow();
ActivityChooserModel dataModel = mAdapter.getDataModel();
if (dataModel != null) {
dataModel.registerObserver(mModelDataSetOberver);
try {
dataModel.registerObserver(mModelDataSetOberver);
} catch (IllegalStateException e) {
// Related to #557.
}
}
mIsAttachedToWindow = true;
}
Expand Down Expand Up @@ -661,7 +665,11 @@ public void setDataModel(ActivityChooserModel dataModel) {
}
mDataModel = dataModel;
if (dataModel != null && isShown()) {
dataModel.registerObserver(mModelDataSetOberver);
try {
dataModel.registerObserver(mModelDataSetOberver);
} catch (IllegalStateException e) {
// Related to #557.
}
}
notifyDataSetChanged();
}
Expand Down

0 comments on commit 9c7de5a

Please sign in to comment.