BrowseErrorFragment: fix NPE of not attached BackgroundManager
BrowseErrorFragment also shows Background for selected item. Need attach BackgroundManager to window. b/22796403 Change-Id: I80bbaf48c85a318fdd0e07d4efd3d1b72876c03d
This commit is contained in:
@@ -39,6 +39,18 @@ public class BrowseErrorActivity extends Activity
|
||||
testError();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
BackgroundHelper.attach(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
BackgroundHelper.release(this);
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
private void testError() {
|
||||
mErrorFragment = new ErrorFragment();
|
||||
getFragmentManager().beginTransaction().add(R.id.main_frame, mErrorFragment).commit();
|
||||
|
||||
Reference in New Issue
Block a user