Question

I have android application that use 12 tabs in my apps. And each tab has approximately 10 viewpager. I have a problem with memory because the application will create new instance of activity if I open the active tabs. And slow down when the all tabs has been opened, I got (Application Not Responding" (ANR).

And it happened continuously when I has opened all the tabs. I still don't know how to handle the memory. I want to dispose the recent opened tab but I don't know how to do it in Android.

Anyone can help me solve this issue?

Était-ce utile?

La solution

Having an activity that has 12 tabs and on each tab having view pagers is not that memory consuming. Having ANRs means you're doing something time consuming on UI thread. ANR has nothing to do with bad memory management. Here's an article from Romain Guy explaining how to track down the UI performance issues.

Autres conseils

Hi my suggestion to you is you need to work with fragments, and use fragemnts accordingly, you can update on loading them on yours view. for this purpose please follow the given link which will help you.

http://www.codeproject.com/Articles/678093/Fragments-Creating-a-Tabbed-Android-User-Interface

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top