I'm developing an app by using sliding tab.After refreshing the data in one tab and while i'm going to another tab the text is coming twice.How to solve this problem. I'm using the adapter class.
Here is my code.
mSwipeRefreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.swifeRefresh);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
AsyncFetch();
upcomingJobs.clear();
upcomingJobs.addAll(upcomingJobs);
// fire the event
uAdapter.notifyDataSetChanged();
// uAdapter.notifyDataSetChanged();
}
});
mSwipeRefreshLayout.setRefreshing(false);
Add this function in your adapterClass:
And then call it at the start of your