android - Crash when trying to use DirectionalViewPager (by Jake Wharton) -
i looked through questions on stack overflow similar problem, haven't managed find solution, suites case.
i need implement following structure: fragment being replaced fragment b. fragment b contains viewpager, switches fragments c1 , c2. works great if use viewpager support library, problem is, need viewpager use vertical swipe. purpose i'm using library jake wharton here https://stackoverflow.com/a/14268702/1220743.
some code:
a being replaced b
fragment fragment = new fragmentb(); string tag = this.getclass().getname(); fragmentmanager fm = getfragmentmanager(); fm.begintransaction().replace(r.id.container, fragment).addtobackstack(tag).commit();
b initializes directionalviewpager
directionalviewpager viewpager = (directionalviewpager)v.findviewbyid(r.id.view_pager); fragmentmanager fm = getfragmentmanager(); viewpager.setadapter(new myviewpageradapter(fm));
this gives me crash when switches b, following crash stack:
08-18 16:47:02.320: e/androidruntime(29610): fatal exception: main 08-18 16:47:02.320: e/androidruntime(29610): java.lang.illegalstateexception: recursive entry executependingtransactions 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1450) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl.executependingtransactions(fragmentmanager.java:478) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentstatepageradapter.finishupdate(fragmentstatepageradapter.java:163) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.view.directionalviewpager.populate(directionalviewpager.java:399) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.view.directionalviewpager.onattachedtowindow(directionalviewpager.java:550) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.view.dispatchattachedtowindow(view.java:13029) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.dispatchattachedtowindow(viewgroup.java:2683) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.dispatchattachedtowindow(viewgroup.java:2690) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.dispatchattachedtowindow(viewgroup.java:2690) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.addviewinner(viewgroup.java:3778) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.addview(viewgroup.java:3610) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.addview(viewgroup.java:3555) 08-18 16:47:02.320: e/androidruntime(29610): @ android.view.viewgroup.addview(viewgroup.java:3531) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:949) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1115) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.backstackrecord.run(backstackrecord.java:682) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1478) 08-18 16:47:02.320: e/androidruntime(29610): @ android.support.v4.app.fragmentmanagerimpl$1.run(fragmentmanager.java:446) 08-18 16:47:02.320: e/androidruntime(29610): @ android.os.handler.handlecallback(handler.java:730) 08-18 16:47:02.320: e/androidruntime(29610): @ android.os.handler.dispatchmessage(handler.java:92) 08-18 16:47:02.320: e/androidruntime(29610): @ android.os.looper.loop(looper.java:176) 08-18 16:47:02.320: e/androidruntime(29610): @ android.app.activitythread.main(activitythread.java:5419) 08-18 16:47:02.320: e/androidruntime(29610): @ java.lang.reflect.method.invokenative(native method) 08-18 16:47:02.320: e/androidruntime(29610): @ java.lang.reflect.method.invoke(method.java:525) 08-18 16:47:02.320: e/androidruntime(29610): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1046) 08-18 16:47:02.320: e/androidruntime(29610): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:862) 08-18 16:47:02.320: e/androidruntime(29610): @ dalvik.system.nativestart.main(native method)
has faced similar problems?
Comments
Post a Comment