android - change fragment by swiping or pushing button differences -


i have activity has 3 fragments. when i'm switching fragments swiping ok. on fragment 2 have button must set current fragment fragment 1. pushing button changes fragment problems expressed in pics pics when normal on that. similar here normal 1 that . works correct on devices higher performance. how solve problem , problem connected?

button listener

onclicklistener btnlistener = new onclicklistener() {         @override         public void onclick(view v) {             ((mainactivity)getactivity()).changefragment(2);         }     }; 

also here info mainactivity

mainactivity extends fragmentactivity implements clfragment.onfragmentinteractionlistener, fmfragment.onfragmentinteractionlistener 

and

private class screenslidepageradapter extends fragmentstatepageradapter {         public screenslidepageradapter(fragmentmanager fm) {             super(fm);         }          @override         public fragment getitem(int position) {             if (position == 0) {                 return new clfragment();             } else if (position == 1) {                 return new vfragment();             } else {                 return fmfragment.newinstance();             }         }          @override         public int getcount() {             return page_count;         }     } 


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -