Created
March 29, 2016 03:40
-
-
Save appcoreopc/7d2ec7abd582afdf3b0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class PlaceholderFragment extends Fragment { | |
/** | |
* The fragment argument representing the section number for this | |
* fragment. | |
*/ | |
private static final String ARG_SECTION_NUMBER = "section_number"; | |
/** | |
* 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 PlaceholderFragment() { | |
} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
View rootView = inflater.inflate(R.layout.fragmentviewsimple, container, false); | |
TextView textView = (TextView) rootView.findViewById(R.id.section_label); | |
textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); | |
return rootView; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment