android fragments - Change Orientation with different layout (Out of memory) -
my app have 2 different layouts, 1 portrait , landscape. define 2 .xml same name change position of view. things work until change orientation. when change orientation "out of memory". use class extend of "fragmentstatepageadapter" create fragments. override "onconfigurationchange", this:.
setcontentview(r.layout.main); //if don't use this, views not change fragmentstatepageradapter = new fragmentstatepageradapterpersonal(fragmentmanager); viewpager.setadapter(fragmentstatepageradapter); fragmentstatepageradapter.notifydatasetchange();
i solved problem adding next line remove out of memory in "onconfigurationchange"
viewpager.setadapter(null); fragmentstatepageradapter.notifadatasetchanged();
Comments
Post a Comment