Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way of showing Stream Data in Android Listview

We are trying to show a table data on a listview. The data consists of 8 columns and around 50 rows. In one second period approximatelly 8 update data comes. (ie:update row2-column5 to something.) Every time a new data comes, we are updating the dedicated cells and we call datasetchanged() of the adapter and this causes some performance and scrolling problems.

My question is:
What is the best way of showing stream data in Android using standard widgets?

like image 927
e13420xx Avatar asked Jul 18 '11 10:07

e13420xx


1 Answers

You could try refreshing only the items that need updating. To do so, you will need the position of the data in the listview.

private void updateData(int position)
{
    int firstItem = listView1.getFirstVisiblePosition();
    View view = listView1.getChildAt(position - firstItem);
    TextView tv = (TextView)view.findViewById(R.id.textview);
    tv.setText("Example Text");
}
like image 135
A. Abiri Avatar answered Oct 20 '22 09:10

A. Abiri