showSlice was being called which would clear the content observer, instead
specify slice and reinflate within setSlice(uri) method.
Test: Have a slice, call notifyContentChanged on the uri, note that it
updates
Change-Id: I5ce8af2867114b9d053f1623bc4a47dfabe961fc
validate(sliceUri);
Slice s = Slice.bindSlice(mContext.getContentResolver(), sliceUri);
if (s != null) {
+ if (mObserver != null) {
+ getContext().getContentResolver().unregisterContentObserver(mObserver);
+ }
mObserver = new SliceObserver(new Handler(Looper.getMainLooper()));
if (isAttachedToWindow()) {
registerSlice(sliceUri);
}
- showSlice(s);
+ mCurrentSlice = s;
+ reinflate();
}
return s != null;
}