数据变化自动通知ViewPager的适配器:Android AutoNotifyViewPager
                 jopen
                 11年前
            
                    Android AutoNotifyViewPager这个项目是ViewPager的升级版。当内容被改变时,会自动通知viewpager的适配器。
- By default ViewPager's 
adaptershould be notified using mAdapter.notifyDataSetChanged() if data get's changed after setting adapter to avoid IllegalStateException - It get's difficult to update your adapter when 
PagerAdapteris in other class, typically different *.java - Example :
- In this app, 
ListView's adapter&ViewPager's adaptershare's same content. - When scrolled down to bottom of the page in ListView, 
GetMoreDatais triggered, fetched, parsed & updated to ListView's adapter. - Seems easy, but when the user clicks & navigates to 
ViewPagerafter triggered and before updated, you end up inIllegalStateExceptionas the data got changed but not notified. - This can be avoided having complex 
eventListeners, instead simply use AutoNotifyViewPager 
 - In this app,