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 6758611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:49:06+00:00 2026-05-26T13:49:06+00:00

I’m creating android app that has table layout for the main activity, and that

  • 0

I’m creating android app that has table layout for the main activity, and that part works perfectly… Now, the idea was to add another part of an app below the existing components, but now I have to put a tabbed layout there. Well, that part also works perfectly when I try to run just that. But what do I have to do to mix those two in such a way that these two show up one below another on the very same screen.

My main code is:

package my.android;

import android.os.Bundle;

public class MyActivity extends FragmentActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

I have different layout files for all the tabs and I have my TabsActivity class I have created following the tutorial here:
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

So how do I add some TabsActivity ta object to the MyActivity? And it is important to be below the content of this. Thaks in advance…

  • 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-05-26T13:49:08+00:00Added an answer on May 26, 2026 at 1:49 pm

    Ideally this would be done using nested Fragments, but Android doesn’t support that yet. That leaves the deprecated ActivityGroup class. You’ll need a top level activity that extends ActivityGroup and launches the two activities.

    Here is how you launch the activities and get their views:

    final Window w = getLocalActivityManager().startActivity(myTag, myIntent);
    final View wd = w != null ? w.getDecorView() : null;
    if (  null != wd ) {
        wd.setVisibility(View.VISIBLE);
        wd.setFocusableInTouchMode(true);
    }
    // TODO: Attach wd to a ViewGroup.
    

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Edit: Below is a more complete solution.

    This is the layout for the top level activity:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/root_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" 
        > 
    </LinearLayout>
    

    Here is the top level class:

    public class EmbeddedActivityParent extends ActivityGroup {
    
        private LinearLayout    mRootLayout;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.main);
    
             mRootLayout = (LinearLayout) findViewById(R.id.root_layout);
    
             // Add embedded status activity.
             embedActivity("StatusColumn", new Intent(this, StatusActivity.class));
    
             // Add embedded work activity.
             embedActivity("WorkArea", new Intent(this, MainActivity.class));
        }
    
        private void embedActivity(String myTag, Intent launchIntent) {
             final Window w = getLocalActivityManager().startActivity(myTag, launchIntent);
             final View wd = w != null ? w.getDecorView() : null;
             if (  null != wd ) {
                 wd.setVisibility(View.VISIBLE);
                 wd.setFocusableInTouchMode(true);
    
                 mRootLayout.addView(wd);
             }
        }
    }
    

    You can add as many embedded activities as you want. You can even nest embedded activities, but be aware that performance could become a factor. We use this to support a dynamic status column.

    Personally, I think there is still a use for the ActivityGroup and hope that Gooogle changes their mind about deprecating it.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.