Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:11:15+00:00 2026-06-11T07:11:15+00:00

I really like the template for Tabs+Swipe. You know…this one: The problem is, I

  • 0

I really like the template for Tabs+Swipe. You know…this one:

enter image description here

The problem is, I do not know where to start after creating that template. How to put a layout into each tab page?

Can we do something like call a Class when the tab is selected? So I can store the view for first tab in Class A then second tab in Class B.

I cannot found any information about this in Google, maybe because it is a new feature from Android SDK?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:11:16+00:00Added an answer on June 11, 2026 at 7:11 am

    How to put a layout into each tab page?

    The generated code creates a ViewPager in the layout file and wires up action bar tabs to the pages in that ViewPager. Personally I’d rather use a PagerTabStrip, or possibly one of the ViewPagerIndicator equivalents, but they didn’t ask me… 🙂

    Regardless, to fill in the pages, you need to replace (or complete) the SectionsPagerAdapter and/or DummySectionFragment inner classes of the generated activity. Right now, this is set up to have three pages, each of which is merely a TextView. But, you could have DummySectionFragment inflate a layout instead, and if you are looking for different layouts per tab, you would probably create separate Fragment implementations per layout/tab combination. You would then teach SectionsPagerAdapter how many pages you want (getCount()) and what to use for each page (getItem()) and what each tab caption is (getPageTitle()).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really like the following template to create properties for class in VS2005 Type
I really like Template Toolkit and like how it works with Catalyst , but
I would really like to make a form instance a model attribute so that
I am creating a template-only C++ library. However, I'd like to provide an 'empty'
I've download the Refresh template by Styleshout.com since I really like it. But unfortunately,
I know this looks like a silly question, but using object oriented stuff with
Given a template like template<int dim> class Point { ... }; this template can
I read this post and I really like this solution to templating but I
I really like the magento structure but finding things is very hard ;) My
I really like the MVC way and have actually enjoyed learning ASP.NET MVC (I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.