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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:49:38+00:00 2026-05-29T11:49:38+00:00

public class Boards : TabActivity { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Tab);

  • 0
public class Boards : TabActivity
{
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        SetContentView(Resource.Layout.Tab);

        TabHost.TabSpec spec;
        Intent intent;

        intent = new Intent(this, typeof(Today));
        intent.AddFlags(ActivityFlags.NewTask);

        spec = TabHost.NewTabSpec("today");
        spec.SetIndicator("Today");
        spec.SetContent(intent);
        TabHost.AddTab(spec);

        intent = new Intent(this, typeof(Tomorrow));
        intent.AddFlags(ActivityFlags.NewTask);

        spec = TabHost.NewTabSpec("tomorrow");
        spec.SetIndicator("Tomorrow");
        spec.SetContent(intent);
        TabHost.AddTab(spec);

        TabHost.CurrentTab = 1;
    }
}

Tab.axml

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@android:id/tabhost"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">
   <LinearLayout 
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
      <TabWidget
         android:id="@android:id/tabs"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"></TabWidget>
      <FrameLayout
         android:id="@android:id/tabcontent"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"></FrameLayout>
   </LinearLayout>
</TabHost>

Today.cs

public class Today : ExpandableListActivity
{
   protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

       List<IDictionary<string, object>> parent = new List<IDictionary<string,object>>();
       List<IList<IDictionary<string, object>>> child = new List<IList<IDictionary<string,object>>>();

        External inst = new External();
        var connection = inst.conn();
        var c = connection.CreateCommand();
        c.CommandText = "Select Distinct Store From Calls";
        connection.Open();
        SqliteDataReader dr = c.ExecuteReader();
        if (dr.HasRows)
            while (dr.Read())
            {
                Dictionary<string, object> pItem = new Dictionary<string,object>();
                pItem.Add("Store", dr[0].ToString());
                parent.Add(pItem);
            }
       dr.Close();
       int cnt = parent.Count();

       if (cnt > 0)
       {
           List<IDictionary<string, object>> children = new List<IDictionary<string, object>>();
           foreach(IDictionary<string, object> d in parent)
           {
               c.CommandText = "Select CallNumber From Calls Where Store = '" + d.Values + "'";
               dr = c.ExecuteReader();
               while (dr.Read())
               {
                   Dictionary<string, object> childItem = new Dictionary<string, object>();
                   childItem.Add("Call", dr[0].ToString());
                   children.Add(childItem);
               }
               dr.Close();
           }
           child.Add(children);
       }

       SimpleExpandableListAdapter adapter = new SimpleExpandableListAdapter(this, parent, Android.Resource.Layout.SimpleExpandableListItem1, new string[] { "Store" }, new int[] { Android.Resource.Id.Text1, Android.Resource.Id.Text2 }, child, Android.Resource.Layout.SimpleExpandableListItem2, new string[] { "Call" }, new int[] { Android.Resource.Id.Text1, Android.Resource.Id.Text2 });
       SetListAdapter(adapter);
    }

}

The tabs create just fine but if I click on the Today tab bringing up the ExpandableListViewActivity, nothing shows up. I changed the LinearLayout in the Tab.axml to Relative and then the ExpandableListView shows up but the first item is on top of the today tab and attempting to expand the item crashes the app.

App when Tab.axml has LinearLayout

enter image description here

App when Tab.axml has RelativeLayout
enter image description here

  • 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-29T11:49:39+00:00Added an answer on May 29, 2026 at 11:49 am

    Got it working. The solution is to leave the Tab.axml with a relative layout and specify the FrameLayout is below the TabWidget.

    <FrameLayout
    android:id="@android:id/tabcontent"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@android:id/tabs">
    </FrameLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class MyClass { public int Age; public int ID; } public void MyMethod()
public class Test { public static void main(String[] args) { } } class Outer
public class doublePrecision { public static void main(String[] args) { double total = 0;
public class WrapperTest { static { print(10); } static void print(int x) { System.out.println(x);
public class WrapperTest { public static void main(String[] args) { Integer i = 100;
public class Main3 { public static void main(String[] args) { Integer min = Integer.MIN_VALUE;
1 public class TestWin{ 2 public static void main(String[] args){ 3 int n; 4
public class Item { ... } public class Order { public List<Item> Items ...
public class Address { public string ZipCode {get; set;} } public class Customer {
public class CovariantTest { public A getObj() { return new A(); } public static

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.