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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:09:27+00:00 2026-06-06T06:09:27+00:00

I have a tabs as views in my activity. Each tab represents a ListView

  • 0

I have a tabs as views in my activity. Each tab represents a ListView. To clarify things further, the ListViews don’t have any TextViews inflated. Since there isn’t a text attribute for a ListView in xml schema, I was wondering if I could do it inside my activity. If not then what would you suggest?

layout file: tabworkentry.xml

<?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:id="@+id/tablayout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <!-- Include action bar -->
<include layout="@layout/actionbar_layout"/>

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"

        android:background="@drawable/innerdashboard_bg"
        android:layout_weight="1">

        <!-- Top 10 starts -->

            <ListView 
            android:id="@+id/Top_10"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:paddingRight="5dp" 
            android:text="this is a tab" />

        <!-- Top 10 ends -->

        <!-- Billable starts -->
        <ListView 
            android:id="@+id/Billable"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:paddingRight="5dp" 
            android:text="this is another tab" />

        <!-- Billable ends -->

        <!-- Product starts -->
        <ListView
            android:id="@+id/Product"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:paddingRight="5dp"
            android:textSize="14sp"
            android:text="this is a third tab" />

        <!-- Product ends -->

     </LinearLayout>
</TabHost>

And java code:

protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    try {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabworkentry);

TabHost  mTabHost = getTabHost();

 mTabHost.addTab(mTabHost.newTabSpec("top10").setIndicator("Top  10").setContent(R.id.Top_10));
          mTabHost.addTab(mTabHost.newTabSpec("billable").setIndicator("Billable").setContent(R.id.Billable));
     mTabHost.addTab(mTabHost.newTabSpec("product").setIndicator("Product").setContent(R.id.Product));

  mListView = (ListView)findViewById(R.id.Top_10);
  mListView.setAdapter(new ArrayAdapter<String>(this,
  android.R.layout.simple_list_item_1,Top_10));   

  mListView = (ListView)findViewById(R.id.Billable);
  mListView.setAdapter(new ArrayAdapter<String>(this,
  android.R.layout.simple_list_item_1,Billable));

 mListView = (ListView)findViewById(R.id.Product);
 mListView.setAdapter(new ArrayAdapter<String>(this,
 android.R.layout.simple_list_item_1,Product));


    } catch (Exception e) {
        System.out.println("Exception" + e.getStackTrace());
        Log.d(TAG, "Exception" + e.getStackTrace());
    }
}  
  • 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-06T06:09:28+00:00Added an answer on June 6, 2026 at 6:09 am

    you have to create own row layout and add TextView then you can set Text font…

    Using custom layout you can do it…

    so inflate R.layout.row

    row.xml

    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp" android:typeface="serif"
        android:textSize="15dp" >
    </TextView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several tabs in my application, and each tab loads a different sub-page
Here's my problem: I've have an application with tabs. in each tab I have
Hi i currently have an Activity that hosts a tab view, and each tab
I have an application with various tabs (on a tabhost). Each tab is an
I have a tabactivity with several tabs. Each tab has an ActivityGroup associated with
I have an app that has 2 tabs. Each tab loads an xml file
I have a TabActivity that has a TabHost with two tabs. Each tab has
I have an activity that has two tabs and a list view in each.
I have three tabs. When I press the tab button on the bottom, is
I have Two Tabs Tab-1 and Tab-2 at bottom of the screen. Send button

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.