listview('refresh') on android ICS 4.x makes list go blank. Phonegap.

listview('refresh') on android ICS 4.x makes list go blank. Phonegap.

Hey there,

Been using jquery mobile for a while now so i'm pretty sure this isn't a basic question.

I have a page with:
  1. <ul id="mylist"></ul>

When i get a array back from a succesful web service call i declare the list:
  1. $("#mylist").listview();

I then empty my listview as I am completely refreshing the data:
  1. $("#mylist").empty();

I then append to my list in a loop:
  1. $("#mylist").append('<li>test</li>');

Then once finished i refresh:
  1. $("#mylist").listview('refresh');

I have tested my code on Android 2.x, iOS and blackberry with phonegap and it works great.

BUT on Android 4.x (ICS). The list loads into the page fine, but second i run listview('refresh') the list becomes a blank white box.

From what i understand the listview('refresh') applies the formatting onto the list and adds any new items (but in my example it is blank so they are all new).

Anybody have any ideas about this?




















    • Topic Participants

    • olly