-1


I have an navigation drawer Activity in which I have made 3 fragments using ViewPager. Each of the fragment has an edit Text, Image button and RecyclerView. The RecyclerView is getting data from a local SQLite database.

On opening the app, I get a Log trace that application skipped XX frames. (Usually 30-50 frames). Is it normal ?

If not, then what should I do? Can fragments be made using background thread like AsyncTask? Or should I populate RecyclerView in background thread?

1 Answers1

0

Is it normal?

Nope. Check out Choreographer (start at line 619) if you are eager to find out what's happening behind the scenes.

what should I do? Can fragments be made using background thread like AsyncTask?

You can't do anything with Views on a background Thread since that would cause a CalledFromWrongThreadException, but what you definitely can and should do is moving all performance-heavy operations like DB read/write to worker Threads. Check out the AsyncTask and AsyncTaskLoader chapter from "Android Developer Fundamentals Course", it will give you a good start on background processing.

Also note that the LoaderManager from the support library is not deprecated.

Droidman
  • 11,485
  • 17
  • 93
  • 141