I am stuck in a weird problem for some 2 days now, kindly help if someone knows what exactly it is.
Problem being, I have a note making app with tab view
(3 swipe tabs somewhat like watsapp's tabs).
FYI , I have Android View Pager
swipe tabs.
Tabs
are simply created from TabLayout
Say Tab1
, Tab2
,Tab3
.
Tab1
just has an edittext
(where user enters text data (notes)).
Tab2
has a (list view
) list of all notes created by user.
Tab3
just has some setting options for app.
Problem is -- when user enters lots of text in Tab1
(edittext
) (a lot here means say 1 Mb
of text),
Then the swipe becomes really heavy, and if you try to move to other tabs (from Tab1 -->to--> Tab2 and vice versa ,also switching from tab3 to tab1 ),it stucks a lot .
Although (Tab2--->tab3 or tab3 to tab2) is smooth. (tab2 and 3 do not have anything in it right now).
THINGS I HAVE TRIED :
1) Read most related questions on SO , none helped.
2) checked logcat
to see if my fragments are created again n again when I switch to it... so they are not recreated.
3) set viewPager.setOffscreenPageLimit(3);
to prevent reloading of fragment on each swipe.
Here is the link to some part of my code.