WeekCalendar
WeekCalendar copied to clipboard
RuntimeException, Fragment not in fragment manager
Happens on a Nexus 6s. The extent of the information I can get.
java.lang.RuntimeException: Unable to resume activity {MainActivity}: java.lang.RuntimeException: Could not dispatch event: class noman.weekcalendar.eventbus.Event$SetSelectedDateEvent to handler [EventHandler public void noman.weekcalendar.view.WeekPager.setSelectedDate(noman.weekcalendar.eventbus.Event$SetSelectedDateEvent)]: Fragment WeekFragment{78b5676} is not currently in the FragmentManager
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.RuntimeException: Could not dispatch event: class noman.weekcalendar.eventbus.Event$SetSelectedDateEvent to handler [EventHandler public void noman.weekcalendar.view.WeekPager.setSelectedDate(noman.weekcalendar.eventbus.Event$SetSelectedDateEvent)]: Fragment WeekFragment{78b5676} is not currently in the FragmentManager
at com.squareup.otto.Bus.throwRuntimeException(Bus.java:460)
at com.squareup.otto.Bus.dispatch(Bus.java:387)
at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:368)
at com.squareup.otto.Bus.post(Bus.java:337)
at noman.weekcalendar.eventbus.BusProvider.post(BusProvider.java:26)
at noman.weekcalendar.WeekCalendar.setSelectedDate(WeekCalendar.java:165)
at passio.fastfooddiary.MainActivity.onResume(MainActivity.java:349)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1258)
at android.app.Activity.performResume(Activity.java:6327)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
... 10 more
Caused by: java.lang.IllegalStateException: Fragment WeekFragment{78b5676} is not currently in the FragmentManager
at android.support.v4.app.FragmentManagerImpl.saveFragmentInstanceState(FragmentManager.java:687)
at android.support.v4.app.FragmentStatePagerAdapter.destroyItem(FragmentStatePagerAdapter.java:136)
at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:418)
at noman.weekcalendar.view.WeekPager.initPager(WeekPager.java:56)
at noman.weekcalendar.view.WeekPager.setSelectedDate(WeekPager.java:102)
at java.lang.reflect.Method.invoke(Native Method)
at com.squareup.otto.EventHandler.handleEvent(EventHandler.java:89)
at com.squareup.otto.Bus.dispatch(Bus.java:385)
... 18 more
Can you try getChildFragmentManager()
instead of 'getSupportFragmentManager()` ? It may helps you.
I don't use getSupportFragmentManager anywhere. This occurs on other devices and renders auto run on android studio not possible. I'll see if changing this in the library fixes it (which might have been what you meant :) )
MainActivity extends AppCompatActivity