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

  • Home
  • SEARCH
  • 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 8958879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:19:05+00:00 2026-06-15T15:19:05+00:00

I created a project using Eclipse Juno with ADT selecting the swipe+tab model for

  • 0

I created a project using Eclipse Juno with ADT selecting the swipe+tab model for ICS version. I see in the generated code that there is a section that creates a textview and places the page/tab number in the center of the textview presented at runtime.

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        // Create a new TextView and set its text to the fragment's section
        // number argument value.
        TextView textView = new TextView(getActivity());
        textView.setGravity(Gravity.CENTER);
        textView.setText(Integer.toString(getArguments().getInt(ARG_SECTION_NUMBER)));
        return textView;

However, instead of presenting a textview on each tab, I would like to present an XML file from my Layouts… a unique layout for each tab. I think I need to use something like this:

setContentView(R.layout.tab1);

OR

setContentView(R.layout.tab2);

But I cannot seem to figure out how to get this to work in my tabs. Advice?

  • 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-15T15:19:06+00:00Added an answer on June 15, 2026 at 3:19 pm

    Figured out how to present my XML Layout file (main.xml) in one of the tabs by using this code:

        public DummySectionFragment() {
        }
    
        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            // Create a new TextView and set its text to the fragment's section
            // number argument value.
    
            if ((getArguments().getInt(ARG_SECTION_NUMBER)==1)) {
                View view = inflater.inflate(R.layout.main, container, false);
                return view; 
                }
                else {
                    TextView textView = new TextView(getActivity());
                    textView.setGravity(Gravity.CENTER);
                    textView.setText(Integer.toString(getArguments().getInt(ARG_SECTION_NUMBER)));
                    return textView;
            }
        }
    

    Hope this helps you too!

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

Sidebar

Related Questions

I have created an android project using eclipse.the default system generated code looked as
Project explained below is created and built using Eclipse Juno(4.2). We receive the following
Using Eclipse Juno Service Release 1, I created a Google App Engine project and
I have recently just created Java project using Eclipse that requires 2 JAR files
I am trying to create an android project using eclipse IDE,its created successfully but
I successfully created a project using Wicket quickstart and turned it into an Eclipse
I have recently created a web project in Java using eclipse. I have a
i'm using eclipse platform and window builder pro within. I've already created new project
I have created a maven project in eclipse using the maven2eclipse plugin. I then
I've created a project using PyDev plugin for Eclipse. Now I need to add

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.