Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.support.v4.app.FragmentManager and android.app.FragmentManager in ViewPager

guys.

I develop an app for Android API 14 and higher but I want to use ViewPager that comes in Android Support Library.

ViewPager needs FragmentPagerAdapter that uses android.support.v4.app.FragmentManager in the constructor. But within my activities I obviously have only android.app.FragmentManager because they extend android.app.Activity (not android.support.v4.app.FragmentActivity).

Is there any way to convert android.app.FragmentManager to android.support.v4.app.FragmentManager?

Extend my activities from FragmentActivity is not an option for me.

like image 419
Slava Avatar asked Sep 27 '13 10:09

Slava


1 Answers

You have to use the v13 support library, which includes a ViewPager using a normal FragmentManager :)

like image 63
AMerle Avatar answered Oct 28 '22 02:10

AMerle