Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suggest you change the OrdersReady[] into ArrayList. Initialize it in your onCreate method. Also make the orderReady adapter into a class field.</p> <pre><code>orderReadyArray = new ArrayList&lt;OrderReady&gt;(); ordersReadyAdapter = new OrderReadyAdapter(this,R.layout.listview_item_row, orderReadyArray); lView = (ListView)findViewById(R.id.listView1); View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null); lView.addHeaderView(header); lView.setAdapter(ordersReadyAdapter); </code></pre> <p>This should initialize an empty listview as you don't have the data yet.</p> <p>When you receive OrdersReady data from the server, update orderReadyArray as such:</p> <pre><code>orderReadyArray.clear(); // remove old data for (int i = x; i &lt; TotalRecords; i++ ) { orderReadyArray.add(data); // add new data one by one } ordersReadyAdapter.notifyDataSetChanged(); // this forces the listview to repaint </code></pre> <p>Alternatively:</p> <p>You can create a new adapter and assign it to the listview once you receive the data:</p> <pre><code>List&lt;OrderReady&gt; orderReadyArray = new ArrayList&lt;OrderReady&gt;(); // create a new array to hold data for (int i = x; i &lt; TotalRecords; i++ ) { orderReadyArray.add(data); // add new data one by one } OrderReadyAdapter ordersReadyAdapter = new OrderReadyAdapter(this,R.layout.listview_item_row, orderReadyArray); lView.setAdapter(ordersReadyAdapter); </code></pre> <p>This should update your list. If you still do not see the items, the problem is in the adapter, perhaps you are inflating the row incorrectly in getView() method.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload