Fix content observer in SliceView
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
This commit is contained in:
@@ -210,11 +210,15 @@ public class SliceView extends ViewGroup {
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user