Home > DeveloperSection > Forums > Different content in the tabs
Monaj Singh
Monaj Singh

Total Post:41

Posted on    November-16-2014 10:43 PM

 Android Java 

 1 Reply(s)
 885  View(s)
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?

Anurag Sharma
Anurag Sharma

Total Post:40

Posted on    November-17-2014 3:00 AM

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.

Don't want to miss updates? Please click the below button!

Follow MindStick