View Pager lag on realtime update of listview
View Pager lag on realtime update of listview
I am trying to have a listview which live streams data from server and updates the elements of list view. Below is the code :
if(localId.indexOf(quoteObj.sym)==0){
final String mLtp = quoteObj.ltp;
final TextView textView = array.valueAt(i);
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
textView.setText(mLtp);
}
});
}
I am able to achieve the live updation but with a significant amount of lag in the Viewpager which holds the fragments. I am using a background thread to do get the data and directing the data to correct rows of List View. It's just the UI which I update in the UI thread which perhaps involves a constant jumping between threads.
How could I update the ListView(which updates 20 elements or more in a second realtime!) without laggy performance?
Thanks for your support!
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.