package com.example.TreballFiGrau;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

class PageAdapter extends FragmentPagerAdapter {
	ArrayList<Fragment> fragments;
	
	public PageAdapter(android.support.v4.app.FragmentManager fm) {
		
		super(fm);
		fragments = new ArrayList<Fragment>();
		//Log.d("aki", "despres super");
		fragments.add(new LlistaNoticies());
		fragments.add(new PerfilUsuari());
		//fragments.add(new EscriureNoticia());
		//fragments.add(new Finestra());
		//fragments.add(new Finestra());
		//Log.d("aki", "fin constructor");
		
	}

	@Override 
	public Fragment getItem(int position) {
		Log.d("aki", "getItem");
		return this.fragments.get(position);
	}


    @Override
    public int getCount() {
    	Log.d("aki", "getCountAdapter");
    	return this.fragments.size();
    }

}
