Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting SupportFragmentManager without extending FragmentActivity

I want to use Fragments in my application, but I cannot extend FragmentActivity because my application already extends an activity that is part of a library. Since this means that I cannot call getSupportFragmentManager(), I am looking for a workaround that would allow me to use Fragments without having to extend FragmentActivity. Is it possible?

like image 363
JohnEye Avatar asked Oct 03 '12 13:10

JohnEye


1 Answers

Your library is going to need to extend the FragmentActivity.

I would be concerned about a library that requires you to use their base activities anyway.

As mentioned (where possible) grab the library source code and add it as a library project to eclipse and make its activities extend the FragmentActivity class.

like image 107
Chris.Jenkins Avatar answered Oct 06 '22 21:10

Chris.Jenkins