Viewpager With Fragments Example In Android, You also need to define a string for the contents of the fragment.