Merge "Clean up device profile change listeners for AllApps." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cdfdd444bc
@@ -192,7 +192,6 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
onAppsUpdated);
|
||||
}
|
||||
mAllAppsStore.addUpdateListener(onAppsUpdated);
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
|
||||
// This is a focus listener that proxies focus from a view into the list view. This is to
|
||||
// work around the search box from getting first focus and showing the cursor.
|
||||
@@ -263,6 +262,18 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
mSearchUiManager.initializeSearch(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
mActivityContext.addOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
mActivityContext.removeOnDeviceProfileChangeListener(this);
|
||||
}
|
||||
|
||||
public SearchUiManager getSearchUiManager() {
|
||||
return mSearchUiManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user