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

后端 未结 4 1361
旧巷少年郎
旧巷少年郎 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 08:11

    Change the "import android.support.v13.app.FragmentActivity" to "import android.support.v4.app.FragmentActivity"

    For the undefined part, try this syntax:

    public class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
        public ScreenSlidePagerAdapter (android.support.v4.app.FragmentManager fm) {
            super(fm);
        }
    

    and:

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

    Original suggestion: Have you added the libraries to your build path? Just right-click on the project and the menu item "Java Build Path" will be listed. Select this and add the libraries to your path.

提交回复
热议问题