android - Tab activities getting destroyed when switching -
i have 3 tabs have created in fasion
intent = new intent(this, testlistactivity.class); view tabview = createtabview(mtabhost.getcontext(), tag); tabspec setcontent = mtabhost.newtabspec(tag).setindicator(tabview).setcontent(intent); mtabhost.addtab(setcontent);
in 1 of them have images loading web. problem if switch tabs , come i'm loading images on again. before images stayed there once loaded every time switch tabs activity destroyed. idea might have changed cause this?
i have 3 tabs have created in fasion in 1 of them have images loading web. problem if switch tabs , come i'm loading images on again. before images stayed there once loaded every time switch tabs activity destroyed. idea might have changed cause this? | |||
setoffscreenpagelimit(int)
anywhere?int
param specified how many unfocused tabs loaded @ given time (that is, if it's set 0, reloading tabs). – eric jul 7 '12 @ 1:46tabhost
sharedviewpager
. if you're using same device when worked, check make suresetcontent
not called if content initialized. otherwise, might consider switchingviewpager
(android 4.0 standard, , supported in v4 support library). – eric jul 7 '12 @ 2:27