am e5e3cdf9: am 12df73e9: am 2d883a90: am a1db5fae: Merge "Fix for NPE in CLF" into ub-gmail-ur14-dev
* commit 'e5e3cdf9b31599125116ca906894db7e13453123':
Fix for NPE in CLF
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index f2bb863..0623e9b 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -1307,13 +1307,19 @@
public void onScrollStateChanged(final AbsListView view, final int scrollState) {
mListView.onScrollStateChanged(view, scrollState);
- // If not scrolling, assign default background - white for tablet, transparent for phone
- if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
- getView().setBackgroundColor(mDefaultListBackgroundColor);
+ final View rootView = getView();
- // Otherwise, list is scrolling, so remove background (corresponds to 0 input)
- } else {
- getView().setBackgroundResource(0);
+ // It seems that the list view is reading the scroll state, but the onCreateView has not
+ // yet finished and the root view is null, so check that
+ if (rootView != null) {
+ // If not scrolling, assign default background - white for tablet, transparent for phone
+ if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
+ rootView.setBackgroundColor(mDefaultListBackgroundColor);
+
+ // Otherwise, list is scrolling, so remove background (corresponds to 0 input)
+ } else {
+ rootView.setBackgroundResource(0);
+ }
}
}
}