check whether swipeLayout is null before trying to deal with it
This commit is contained in:
parent
8f6ca0eec0
commit
2af8bc98c8
@ -282,7 +282,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
|
||||
} */
|
||||
|
||||
public void refresh(boolean background) {
|
||||
m_swipeLayout.setRefreshing(true);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
||||
|
||||
CatsRequest req = new CatsRequest(getActivity().getApplicationContext());
|
||||
|
||||
@ -325,7 +325,7 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
|
||||
if (isDetached()) return;
|
||||
|
||||
m_activity.setProgressBarVisibility(false);
|
||||
m_swipeLayout.setRefreshing(false);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false);
|
||||
|
||||
if (getView() != null) {
|
||||
ListView list = (ListView)getView().findViewById(R.id.feeds);
|
||||
|
@ -380,7 +380,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
||||
public void refresh(boolean background) {
|
||||
//FeedCategory cat = m_onlineServices.getActiveCategory();
|
||||
|
||||
m_swipeLayout.setRefreshing(true);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
||||
|
||||
final int catId = (m_activeCategory != null) ? m_activeCategory.id : -4;
|
||||
|
||||
@ -502,7 +502,7 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
||||
|
||||
m_activity.setProgressBarVisibility(false);
|
||||
//m_activity.m_pullToRefreshAttacher.setRefreshComplete();
|
||||
m_swipeLayout.setRefreshing(false);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false);
|
||||
|
||||
if (result != null) {
|
||||
try {
|
||||
|
@ -415,7 +415,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
if (m_activity != null && m_feed != null) {
|
||||
m_refreshInProgress = true;
|
||||
|
||||
m_swipeLayout.setRefreshing(true);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
||||
m_activity.setProgressBarVisibility(true);
|
||||
|
||||
if (!m_feed.equals(GlobalState.getInstance().m_activeFeed)) {
|
||||
@ -463,7 +463,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
super.onPostExecute(result);
|
||||
|
||||
if (isAdded()) {
|
||||
m_swipeLayout.setRefreshing(false);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false);
|
||||
}
|
||||
|
||||
if (result != null) {
|
||||
|
@ -247,7 +247,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
try {
|
||||
if (!isAdded()) return;
|
||||
|
||||
m_swipeLayout.setRefreshing(true);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(true);
|
||||
|
||||
if (m_cursor != null && !m_cursor.isClosed()) m_cursor.close();
|
||||
|
||||
@ -258,7 +258,7 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
|
||||
m_adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
m_swipeLayout.setRefreshing(false);
|
||||
if (m_swipeLayout != null) m_swipeLayout.setRefreshing(false);
|
||||
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
x
Reference in New Issue
Block a user