I tried this example
http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentPagerSupport.html
I build for API Level 15 and use support package as well. This funktion causes trouble:
@Override
public Fragment getItem(int position) {
return ArrayListFragment.newInstance(position);
}
Error Message:
The return type is incompatible with FragmentPagerAdapter.getItem(int)
I found a similar problem but with no clear solution to me Cannot convert from android.support.v4.app.Fragment to android.app.Fragment
Make sure you are using this class: android.support.v4.app.Fragment instead of android.app.Fragment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With