The import android.support.v13.app.FragmentActivity cannot be resolved

后端 未结 4 1362
旧巷少年郎
旧巷少年郎 2020-12-06 07:41

I\'m testing an android project (http://developer.android.com/training/animation/screen-slide.html) and I have an error in one class.

/*
 * Copyright 2012 Th         


        
4条回答
  •  抹茶落季
    2020-12-06 07:54

    I think i should explain the difference...

    if you want to support api <11. Then you should import android.support.v4.app.FragmentPagerAdapter; and then create all Fragment by import android.support.v4.app.Fragment; and you are done.

    API==11

    If you don't want to support api <11. or you simply want to use simple Fragment(without support) then you should import android.support.v13.app.FragmentPagerAdapter; then getItem will need a simple Fragment.

    @Override
        public android.app.Fragment getItem(int position) {
            return ScreenSlidePagerAdapter.create(position);
        }
    

提交回复
热议问题