我在努力奋斗着这个错误,我真的无法得到它的权利。 我尝试导入android.support.v13.app.FragmentActivity;为一类,但它给我的错误:进口android.support.v13.app.FragmentActivity不能得到解决。 我想提一提,我都V13和V4在libs文件夹。我用的清洁,Android的支持库和修复项目属性。目标设备是2.3.3如果该事项。 谢谢。我真的很希望有人能帮助我。 编辑:编辑V4后,很多错误都消失,我有只有2个。我非常初学android的,所以如果你能解释我什么是错在这里:
I'm struggling with this error and I really can't get it right. I try to import android.support.v13.app.FragmentActivity; into a class but it gives me the error: The import android.support.v13.app.FragmentActivity cannot be resolved. I want to mention that I have both v13 and v4 in libs folder. I used Clean,Android Support Library and Fix Project Properties. The target device is 2.3.3 if that matters. Thank you. I really really hope that someone can help me. After editing v4, a lot of errors are disappearing and I've got only 2 more. I'm very beginner in android so if you could explain me what is wrong here:
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
public ScreenSlidePagerAdapter(FragmentManager fm) {
super(fm); //Error: The constructor Fragmentstagepageadapter(FragmentManager) is undefined
}
@Override
public **Fragment** getItem(int position) { //And Here: The return type is incompatible
return ScreenSlidePageFragment.create(position);
}
@Override
public int getCount() {
return NUM_PAGES;
}
}
这是我给了一个非常类似的问题的答案:
This is the answer I gave to a very similar question:
将进口android.support.v13.app.FragmentActivity到进口android.support.v4.app.FragmentActivity
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);
}
和
@Override
public android.support.v4.app.Fragment getItem(int position) {
return ScreenSlidePagerAdapter.create(position);
}