RE: Minecolonis & Getting really stable

You are viewing a single comment's thread from:

Minecolonis & Getting really stable

in utopian-io •  6 years ago 

package com.example.kailash.tabview;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class MyAdapter extends FragmentPagerAdapter {
private Context myContext;
int totalTabs;
public MyAdapter(Context context, FragmentManager fm, int totalTab) {
super(fm);
myContext = context;
this.totalTabs = totalTabs;
}

@Override
public Fragment getItem(int i) {
    switch (i) {
        case 0:
            HomeFragment homeFragment = new HomeFragment();
            return homeFragment;
        case 1:
            game sportFragment = new game();
            return sportFragment;
        case 2:
            MovieFragment movieFragment = new MovieFragment();
            return movieFragment;
        default:
            return null;
    }
}

@Override
public int getCount() {
    return totalTabs;
}

}

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!