Code example for FragmentPagerAdapter

0
 * Created by Administrator on 13-6-30. 
 */ 
public class HeadlinePagerAdapter extends FragmentPagerAdapter { 
    private  final  String category[]; 
    public HeadlinePagerAdapter(String category[],FragmentManager fm) { 
        super(fm); 
        this.category =category; 
 
    } 
 
    @Override 
    public Fragment getItem(int i) { 
        Fragment f = null; 
        switch (i) 
        { 
            case 0: 
                f = new NewsListFragment(); 
                break; 
            default: 
                f = new HotCommentFragment();