我正在制作聊天应用并创建了一个新包。我已粘贴下面的代码。 错误是: 需要:android.support.v4.app.Fragment
实测值:com.marketing.auratek.chatapp.RequestsFragmentcom.marketing.auratek.chatap
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
/**
* Created by Jagan on 7/14/2017.
*/
class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position){
case 0:
RequestsFragment requestsFragment = new RequestsFragment();
return requestsFragment;
case 1:
ChatsFragment chatsFragment = new ChatsFragment();
return chatsFragment;
case 2:
FriendsFragment friendsFragment = new FriendsFragment();
return friendsFragment;
}
return null;
}
@Override
public int getCount() {
return 3;
}
}