Closed JHthe4 closed 8 years ago
I don't have any experience with fragments and Android-Week-View myself. But does this comment help? https://github.com/alamkanak/Android-Week-View/issues/300#issuecomment-229476623
Upon further inspection and debugging, it appears as though there is some persistence issue with the variable mWeekViewLoader of the WeekView class. Passing the MonthChangeListener works and the constructor for WeekViewLoader is being called as well. However, in the method getMoreEvents(), mWeekViewLoader is once again null. Is there some other method resetting this field that is causing the bug?
I don't think so..
In activities it works, so I have no idea why it would only reset it in fragments.
Well, apparently now it works again. It turns out the problem wasn't an underlying bug in the library, or worse, android's definition of fragments: I forgot to remove the old weekView from my layout-v21 xml file. So, for anyone reading this in the future: triple check that you don't have a second weekView being loaded anywhere! @caske33, I'm so sorry for wasting your time!
No problem. I'm glad it's resolved!
Hi. I am trying to implement an AndroidWeekView in a fragment (in which it is the only view), but the app crashes with the error java.lang.IllegalStateException: You must provide a MonthChangeListener, although I have provided one in onCreateView(). The same code worked flawlessly in an activitiy's onCreate(), so I assume there to be an issue with the implementation of the fragment. See my code (shortened to the essentials for readability) below for details. Thanks for any help!