DIFFERENT CONTENT IN THE TABS

Monaj Singh

Total Post:41

Points:287
Posted by  Monaj Singh
Java 
 962  View(s)
Ratings:
Rate this:

I'm using this android studio project, but I didn't know how to change content there.For example, I want to have a text "Hello World" in the first tab, the text "Goodbye..." in the second tab and so on... Can you help me?

  1. Anurag Sharma

    Post:40

    Points:280
    Re: Different content in the tabs

    Did you try anything? There is a sample folder where you can find an example. In the first file I opened, which is MainActivity.java, there is a class called MyPagerAdapter, with the following line:

    private final String[] TITLES = { "Categories", "Home", "Top Paid", "Top Free", "Top Grossing", "Top New Paid", "Top New Free", "Trending" };

    Seems to me you can change that to

    private final String[] TITLES = {"Hello world", "Goodbye..."};

    If that doesn't work you do have a valid question, but in this case you should have checked the sample first. Literraly took me less than a minute to find.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!