Android.support.v4.view.pageradpter and viewpager cannot match

Directly on the picture, this is evidence hahaha, I also specially Insert picture description heredownloaded the android.support.v4.jar package. In fact, the androidx.viewpager.widget.PagerAdapter was automatically imported from the beginning, but it was found that the instantiateItem and destroyitem methods were not automatically rewritten. I rewritten the isViewFromObject and getCount methods, so I thought it was a wrong package. Later, the v4 package did not automatically rewrite those two methods. Looking at the source code, it turns out that PagerAdapter does have instantiateItem and destroyitem methods, but I just have to rewrite it myself , Although AS did not automatically help us rewrite, but we must rewrite. So,, come back to androidx!

Guess you like

Origin blog.csdn.net/qq_41446977/article/details/112205596