I am working on Fragments to do a simple 3 pages application, with slide between page.
But For now, I Have 3 Fragments, but the application slide only with de 2 and 3.
It must do 1 -> 2 -> 3, but It do 3 -> 2 -> 3. If you know what I try to say.
This is my code
public class main extends Activity {
public static SectionsPagerAdapter mSectionsPagerAdapter;
public static Boolean init = true;
static ViewPager mViewPager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
mViewPager = (ViewPager) findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
[...]
}
public static class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
private static int ARG_NUMBER = 0;
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
ARG_NUMBER = sectionNumber;
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public PlaceholderFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = new View(this.getActivity());
// THE PROBLEM SHOULD COME FROM HERE
switch (ARG_NUMBER) {
case 1:
rootView = inflater.inflate(R.layout.fragment_main, container, false);
break;
case 2:
rootView = inflater.inflate(R.layout.fragment_map, container, false);
break;
case 3:
rootView = inflater.inflate(R.layout.profile, container, false);
break;
}
return rootView;
}
}
}
So, if anyone has an idea ... Thanks !
EDIT :
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
return PlaceholderFragment.newInstance(position + 1);
}
#Override
public int getCount() {
// Show 3 total pages.
return 3;
}
#Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
switch (position) {
case 0:
return getString(R.string.title_section1).toUpperCase(l);
case 1:
return getString(R.string.title_section2).toUpperCase(l);
case 2:
return getString(R.string.title_section3).toUpperCase(l);
}
return null;
}
}
you should use arguments of fragment instead of setting ARG_NUMBER = sectionNumber
your code should look something like this:
public static class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
private int ARG_NUMBER = 0;
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public PlaceholderFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = new View(this.getActivity());
ARG_NUMBER = getArguments().getInt(ARG_SECTION_NUMBER, 0);
switch (ARG_NUMBER) {
case 1:
rootView = inflater.inflate(R.layout.fragment_main, container, false);
break;
case 2:
rootView = inflater.inflate(R.layout.fragment_map, container, false);
break;
case 3:
rootView = inflater.inflate(R.layout.profile, container, false);
break;
}
return rootView;
}
}
Note: Use if-else ladder if Switch case does not allow for non-constant value.
Related
I want to use TabActivity in my android app. each viewPager's pages contains 2 TextView and 1 ImageView. I want to write down my texts in ArrayString instead of simple String,but i don't know how to call it inTextView.setText?
my Fragment class:
public static class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = " " ;
public TextView label_TV, info_TV;
public ImageView photo_IMG;
public PlaceholderFragment() {
}
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_bio, container, false);
label_TV = (TextView) rootView.findViewById(R.id.section_label);
//label_TV.setText(?);
info_TV = (TextView) rootView.findViewById(R.id.section_info);
photo_IMG = (ImageView) rootView.findViewById(R.id.section_image);
return rootView;
}
}
FragmentPagerAdapter class:
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
return PlaceholderFragment.newInstance(position + 1);
}
#Override
public int getCount() {
return 6;
}
#Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "SECTION 1";
..
}
return null;
}
}
string file:
<string-array name="titles">
<item>00</item>
<item>11</item>
</string-array>
how can i use titles arrayString for label_TV?
Probably, the best place to do so is via newInstance() method. If it is not dynamic of course :)
Replace your line
return PlaceholderFragment.newInstance(position + 1);
with
return PlaceholderFragment.newInstance((position + 1),your_titles_array,fragment_position);
Now replace your newInstance() with
public static PlaceholderFragment newInstance(int sectionNumber,String[] titlesArray, int fragment_position) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
args.putStringArray("key_title_array",temp);
args.putInt("key_fragment_position", fragment_position);
fragment.setArguments(args);
return fragment;
}
In Oncreate view
Bundle bundle=getArguments();
String[] titlesArray=bundle.getStringArray("key_title_array");
int fragment_position=bundle.getInt("key_fragment_position");
label_TV.setText(titlesArray[fragment_position]);
hope this work :)
I have a TabLayout Activity, and for one of the tabs (case 3) i want to use a PreferenceFragment for a settings page. In case 3 below i've declared the fragment, but how do I start it?
public static class SettingsFragment extends PreferenceFragment {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
}
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = null;
switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
case 1: {
rootView = inflater.inflate(R.layout.fragment_profile, container, false);
break;
}
case 2: {
rootView = inflater.inflate(R.layout.fragment_find, container, false);
break;
}
case 3: {
SettingsFragment fragment = new SettingsFragment();
// what goes here?
break;
}
}
return rootView;
}
full code:
public class Find extends AppCompatActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_find);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
TabLayout.Tab tab1 = tabLayout.getTabAt(0);
tab1.setCustomView(R.layout.icon_view);
tab1.setIcon(R.drawable.profile);
TabLayout.Tab tab2 = tabLayout.getTabAt(1);
tab2.setCustomView(R.layout.icon_view);
tab2.setIcon(R.drawable.logo_a);
TabLayout.Tab tab3 = tabLayout.getTabAt(2);
tab3.setCustomView(R.layout.icon_view);
tab3.setIcon(R.drawable.settings);
}
public static class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public static class SettingsFragment extends PreferenceFragment {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
}
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = null;
switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
case 1: {
rootView = inflater.inflate(R.layout.fragment_profile, container, false);
break;
}
case 2: {
rootView = inflater.inflate(R.layout.fragment_find, container, false);
break;
}
case 3: {
SettingsFragment fragment = new SettingsFragment();
// what goes here?
break;
}
}
return rootView;
}
}
/**
* A {#link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
return PlaceholderFragment.newInstance(position + 1);
}
#Override
public int getCount() {
// Show 3 total pages.
return 3;
}
Separate SettingsFragment from PlaceholderFragment
Update SectionsPagerAdapter's getItem() method to show SettingsFragment for 3rd TAB.
Remove case 3 from onCreateView().
Try this:
public class Find extends AppCompatActivity {
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_find);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
TabLayout.Tab tab1 = tabLayout.getTabAt(0);
tab1.setCustomView(R.layout.icon_view);
tab1.setIcon(R.drawable.profile);
TabLayout.Tab tab2 = tabLayout.getTabAt(1);
tab2.setCustomView(R.layout.icon_view);
tab2.setIcon(R.drawable.logo_a);
TabLayout.Tab tab3 = tabLayout.getTabAt(2);
tab3.setCustomView(R.layout.icon_view);
tab3.setIcon(R.drawable.settings);
}
public static class SettingsFragment extends PreferenceFragment {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
}
}
public static class PlaceholderFragment extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static PlaceholderFragment newInstance(int sectionNumber) {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = null;
switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
case 1: {
rootView = inflater.inflate(R.layout.fragment_profile, container, false);
break;
}
case 2: {
rootView = inflater.inflate(R.layout.fragment_find, container, false);
break;
}
}
return rootView;
}
}
/**
* A {#link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
switch (position) {
case 0: {
return PlaceholderFragment.newInstance(1);
}
case 1: {
return PlaceholderFragment.newInstance(2);
}
case 2: {
SettingsFragment fragment = new SettingsFragment();
return fragment;
}
}
return PlaceholderFragment.newInstance(1);
}
#Override
public int getCount() {
// Show 3 total pages.
return 3;
}
}
}
UPDATE:
To resolve this error you have to use PreferenceFragmentCompat:
1. To use PreferenceFragmentCompat, add below line under dependencies in your build.gradle file:
dependencies {
.........
...............
compile 'com.android.support:preference-v7:25.1.0'
}
2. Extend your SettingsFragment from PreferenceFragmentCompat instead of PreferenceFragment.
import android.support.v7.preference.PreferenceFragmentCompat;
.........
.................
public static class SettingsFragment extends PreferenceFragmentCompat {
#Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
}
}
.........
.................
3. You must specify preferenceTheme in your theme:
styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
.......
...........
<item name="preferenceTheme">#style/PreferenceThemeOverlay</item>
</style>
You can also check tutorial to learn more about PreferenceFragmentCompat.
Hope this will help~
I have 6 Fragments within an activity that I created as
I want to swipe from one to the other and need them to not being dismissed but onyl hide/show y the viewpager.
Is there a way to derive a viewpager class or a SectionsPagerAdapter to do that.
I already add
mViewPager.setOffscreenPageLimit(6);
but it didn't work. When swiping from the 4th fragment to 3rd or to 5th, the app crashes.
Relevant parts of my code simpified and renamed Fragment classes to get the code readable:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// create the fragment once for all !
if (savedInstanceState == null) {
fragment1 = Fragment1.newInstance(1);
fragment2 = Fragment2.newInstance(2);
fragment3 = Fragment3.newInstance(3);
fragment4 = Fragment4.newInstance(4);
fragment5 = Fragment5.newInstance(5);
fragment6 = Fragment6.newInstance(6);
}
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
mViewPager.setOffscreenPageLimit(6);
});
public static class Fragment1 extends Fragment {
private static final String ARG_SECTION_NUMBER = "section_number";
public Fragment1() {
}
public static Fragment1 newInstance(int sectionNumber) {
Fragment1fragment = new Fragment1();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
fragment.setRetainInstance( true);
return fragment;
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_1, container, false);
TextView textView = (TextView) rootView.findViewById(R.id.section_label);
// "Main Frag"
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
return rootView;
}
#Override
public void onResume() {
super.onResume();
// The activity is about to become visible again, recalcule
}
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a PlaceholderFragment (defined as a static inner class below).
//return PlaceholderFragment.newInstance(position + 1);
switch (position)
{
case 0 : return fragment1; //instead of Fragment1.newInstance(1);
case 1 : return fragment2;
case 2 : return fragment3;
case 3 : return fragment4;
case 4 : return fragment5;
case 5 : return fragment6;
default: return null;
}
}
#Override
public int getCount() {
// Show 6 total pages.
return 6;
}
#Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return "SECTION 1";
case 1:
return "SECTION 2";
case 2:
return "SECTION 3";
case 3:
return "SECTION 4";
case 4:
return "SECTION 5";
case 5:
return "SECTION 6";
}
return null;
}
}
Extend your section pager adapter by FragmentSatePagerAdaper
And set
mViewPager.setOffscreenPageLimit(6);
i used this turtorial: http://www.paulusworld.com/technical/android-navigationdrawer-sliding-tabs#comment-2793
to get a swipe view alongside my navigation drawer, but i can't quite figure out how to change the view
in the onCreateView i'm trying to do it with a switch statement but it says "method is not overwriting method from it's superclass
code for fragment:
public class StepFragment extends Fragment {
public static final String TAG = StepFragment.class.getSimpleName();
SectionsPagerAdapter mSectionsPagerAdapter;
ViewPager mViewPager;
public static StepFragment newInstance() {
return new StepFragment();
}
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.step_fragment, container, false);
mSectionsPagerAdapter = new SectionsPagerAdapter(
getChildFragmentManager());
mViewPager = (ViewPager) v.findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
return v;
}
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
Fragment fragment = new TabbedContentFragment();
Bundle args = new Bundle();
args.putInt(TabbedContentFragment.ARG_SECTION_NUMBER, position + 1);
fragment.setArguments(args);
return fragment;
}
#Override
public int getCount() {
return 3;
}
#Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
switch (position) {
case 0:
return getString(R.string.step_title1).toUpperCase(l);
case 1:
return getString(R.string.step_title2).toUpperCase(l);
case 2:
return getString(R.string.step_title3).toUpperCase(l);
}
return null;
}
}
public static class TabbedContentFragment extends Fragment {
public static final String ARG_SECTION_NUMBER = "section_number";
public TabbedContentFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState,int position) {
View view1 = inflater.inflate(R.layout.fragment_step,
container, false);
View view2 = inflater.inflate(R.layout.fragment_step1,
container, false);
switch (position) {
case 0:
return view1;
case 1:
return view2;
}
return null;
}
}
}
Your onCreateView is passing four arguments, the superclass method only takes 3. You need to remove the position arg.
Use the args Bundle that you're setting in getItem() to pass the position. In onCreateView(), get those args and pull the position from that Bundle.
EDIT:
Here's your getItem():
#Override
public Fragment getItem(int position) {
Fragment fragment = new TabbedContentFragment();
Bundle args = new Bundle();
args.putInt(TabbedContentFragment.ARG_SECTION_NUMBER, position + 1);
fragment.setArguments(args);
return fragment;
}
Since your switch statement in onCreateView is looking for a 0 or 1, go ahead and remove the "+ 1" from args.putInt():
#Override
public Fragment getItem(int position) {
Fragment fragment = new TabbedContentFragment();
Bundle args = new Bundle();
args.putInt(TabbedContentFragment.ARG_SECTION_NUMBER, position);
fragment.setArguments(args);
return fragment;
}
Now, in your fragment, you need to get the args and get the position from that:
public static class TabbedContentFragment extends Fragment {
public static final String ARG_SECTION_NUMBER = "section_number";
public TabbedContentFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Bundle args = getArguments();
int position = args.getInt(ARG_SECTION_NUMBER, 0);
View view1 = inflater.inflate(R.layout.fragment_step,
container, false);
View view2 = inflater.inflate(R.layout.fragment_step1,
container, false);
switch (position) {
case 0:
return view1;
case 1:
return view2;
}
return null;
}
}
Right now i'm trying to program an android-application with a navigation drawer and swipe views. When selecting "Timetable" in the navigation drawer, the app opens a swipe view with 6 pages with the page number on every page.
The problem is that - when re-selecting the page "Timetable" in the navigation drawer - the pages 5 and 6 are displayed but the content (fragment) won't load.
I used the code of the swipe view-example: http://developer.android.com/training/implementing-navigation/lateral.html
This should be the fragment with the swipe views:
public class Timetable extends Fragment {
ViewPager mViewPager;
SectionsPagerAdapter mSectionsPagerAdapter;
public TimeTable() {
// Empty constructor required for fragment subclasses
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.screen_stundenplantag,
container, false);
mSectionsPagerAdapter = new SectionsPagerAdapter(this.getActivity()
.getSupportFragmentManager());
mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
mViewPager.setAdapter(mSectionsPagerAdapter);
return rootView;
}
Here's the class SectionsPagerAdapter:
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
#Override
public Fragment getItem(int position) {
// getItem is called to instantiate the fragment for the given page.
// Return a DummySectionFragment (defined as a static inner class
// below) with the page number as its lone argument.
Fragment fragment = new DummySectionFragment();
Bundle args = new Bundle();
args.putInt(DummySectionFragment.ARG_SECTION_NUMBER, position);
fragment.setArguments(args);
return fragment;
}
#Override
public int getCount() {
// Show 6 total pages.
return 6;
}
#Override
public CharSequence getPageTitle(int position) {
Locale l = Locale.getDefault();
switch (position) {
case 0:
return getString(R.string.title_section1).toUpperCase(l);
case 1:
return getString(R.string.title_section2).toUpperCase(l);
case 2:
return getString(R.string.title_section3).toUpperCase(l);
case 3:
return getString(R.string.title_section4).toUpperCase(l);
case 4:
return getString(R.string.title_section5).toUpperCase(l);
case 5:
return getString(R.string.title_section6).toUpperCase(l);
}
return null;
}
}
And last but not least here's the DummySectionFragment-class:
public static class DummySectionFragment extends Fragment {
/**
* The fragment argument representing the section number for this
* fragment.
*/
public static String ARG_SECTION_NUMBER = "";
public DummySectionFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main_dummy,
container, false);
TextView dummyTextView = (TextView) rootView
.findViewById(R.id.section_label);
dummyTextView.append("Page "
+ Integer.toString(getArguments()
.getInt(ARG_SECTION_NUMBER)));
Log.i(this.getClass().getSimpleName(),String.valueOf(getArguments().get(DummySectionFragment.ARG_SECTION_NUMBER)));
switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
}
return rootView;
}
}