0

I have a PullToRefreshListView that i'm switching ArrayAdapters for depending on what options the user selects. I'm able to get the data to show but for some reason, not able to force a redraw on the PullToRefreshListView. So when the list shortens, you can still see the white from when the PullToRefreshListView had more data in it, and therefore was longer.

My code is below:

if (adapter == null) {
    adapter = new CustomAdapter(this.getActivity(), array);

} else {
    adapter.clear();
    adapter.addAll(array);
}

list.setAdapter(adapter);

Is there anything else that I can do to refresh the list? I tried searching several other questions on SO including:

Android - I can't refresh / redraw a ListView

However, it didn't help for my solution.

1 Answer 1

1

I think you need to post more of the code. If the list is shortening, and you see white where it used to be, it is not a problem with the ListView refreshing, it's a problem with the ListView's container refreshing. Does the container have a background set?

Sign up to request clarification or add additional context in comments.

1 Comment

You were right. I was using some open source code and didn't see that until digging in. Case closed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.