how to increase viewpager performance in android -
i'm devoloping simple android app has 2 activity ( let's call activity1 , activity2 ).
activity2 contain viewpager has 50 pages. because want increase performance when switching page of viewpager set offscreenlimit 15 page ( because app use activity 2 ).
for reason when switch activity1 activity2 ( when start app begin activity1 , switch activity2 ) take quite lot of time , make app isn't smooth expected.
to solve problem has been thinking preload activity2 when i'm working on activity1 it's seem android doesn't support preload activity. solution think preload viewpager. don't know how send loaded viewpager between activity
can me out ?
android viewpager automatically caches limited number of pages , not load of them @ once. create required pages on demand. default caches 3 views (one can see, , left 1 , right 1 of current one). optimizing performance, suggest use things using views small sized bitmaps (if have any). mean not use large images background or if can use single-color backgrounds instead of bitmap-backgrounds. 1 improve performance of viewpager.
Comments
Post a Comment