1

I have a lot of getting String from json objects like this:

city1 = jsonobject.getJSONArray("object").getJSONObject(0).getString("city");

And if value not hull i apply this String to textview:

if(city1.equals("")) {
   citylayout.setVisibility(View.GONE);
} else {
prefsmain2.edit().putInt("CITY", city1).commit();
citytxt.setText(city1);
}

I have ~60 parametrs like this (city, landmark, region, country etc...) But i get a log from debugger:

Choreographer: Skipped 33 frames! The application may be doing too much work on its main thread.

Get values from AsyncTask and work with setText on new thread using Handler, but its useless...

ironz
  • 19
  • 4
  • check whether you are fetching `JSON` in `asyncTask` ? ... if you are using `Asynctask` update your `textview` in `onpostexecute` ! – Devrath Aug 01 '14 at 21:35
  • Ironz, your question is answered in this post http://stackoverflow.com/questions/16948937/skipped-60-frames-the-application-may-be-doing-too-much-work-on-its-main-thread. – Loures Aug 01 '14 at 21:53

1 Answers1

0

Try to use a custom view which acts like multiple textviews.Give data to it all at once and invalidate the view.Using this approach u might avoid many redraws which might be causing frame drops.

rupesh jain
  • 3,410
  • 1
  • 14
  • 22