I am working on Facebook integration for my application. All of the fragments I am currently using in my application, as per client requirement, is
android.app.Fragment
. Now, the Fragment we created for Facebook is android.support.v4.app.Fragment
. If we convert it into android.app.Fragment
, the functionality loginButton.setFragment(this);
shows error.
My question is, How can I move from android.app.Fragment
to
android.support.v4.app.Fragment
as this piece of code is giving error:
getActivity().getFragmentManager()
.beginTransaction()
.replace(R.id.content_frame,new MainFragment())
.addToBackStack(null)
.commit();
The error it shows is:
Wrong 2nd argument type. Found: 'com.nicklodean.nicklodean.fragment.MainFragment', required: 'android.app.Fragment'
Please suggest how can I sort out this issue.