Merge branch 'fix-286--refreshHeader-crash' into 'master'
Put null check around access of `R.id.header` fragment. Please note I haven't reproduced the specific problem. Also, the stack traces being reported are only marginally informative, because they are in response to a content providers firing events, and thus don't have any context about when or where the event was fired from. However, my looking at the code seems to indicate that this will prevent NPE when the Activity is no longer visible but an app is finished installing. Also, the view should still update correctly on resuming the Activity because the `onResumeFragments()` methods will be invoked which invokes the `refreshHeaders()` method. Fixes #286. See merge request !202
This commit is contained in:
commit
0646b6473e
@ -609,7 +609,9 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
private void refreshHeader() {
|
private void refreshHeader() {
|
||||||
mHeaderFragment = (AppDetailsHeaderFragment)
|
mHeaderFragment = (AppDetailsHeaderFragment)
|
||||||
getSupportFragmentManager().findFragmentById(R.id.header);
|
getSupportFragmentManager().findFragmentById(R.id.header);
|
||||||
mHeaderFragment.updateViews();
|
if (mHeaderFragment != null) {
|
||||||
|
mHeaderFragment.updateViews();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user