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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:48:32+00:00 2026-06-10T21:48:32+00:00

I am learning to make Tab based apps in android.Got a you must specify

  • 0

I am learning to make Tab based apps in android.Got a “you must specify a way to create tab indicator” error in LogCat.

Heres the code……

.java file……

package com.example.tabdemo;

import android.os.Bundle;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


@SuppressWarnings("deprecation")
public class MainActivity extends TabActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TabHost tabhost=getTabHost();

        TabHost.TabSpec spec1=tabhost.newTabSpec("Tab 1");
        Intent intent1=new Intent(this, Tabone.class);
        spec1.setContent(intent1);
       // spec1.setIndicator("Tab 1", getResources().getDrawable(R.drawable.face));
        spec1.setIndicator("Tab 1");
        tabhost.addTab(spec1);

        TabHost.TabSpec spec2=tabhost.newTabSpec("Tab 2");
        Intent intent2=new Intent(this,Tabtwo.class);
        spec2.setContent(intent2);
     //   spec1.setIndicator("Tab 2", getResources().getDrawable(R.drawable.face));
        spec1.setIndicator("Tab 2");


        tabhost.addTab(spec2);
        tabhost.setCurrentTab(1);
    }
}

activity xml file…

<?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:orientation="vertical"
        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" /> 
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"/> 
    </LinearLayout> 
</TabHost>
  • 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-10T21:48:34+00:00Added an answer on June 10, 2026 at 9:48 pm

    You didn’t set indicator for the tab2

    check your code

    spec2.setContent(intent2);
     //   spec1.setIndicator("Tab 2", getResources().getDrawable(R.drawable.face));
        spec1.setIndicator("Tab 2");
    

    you overwrite your tab1 indicator.

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

Sidebar

Related Questions

I'm still in the process of learning how to make android apps. I'm currently
I am trying to make simple notepad application for learning android development. So, to
I'm still learning Python, and I'd love to know a way to make the
I have a small RIA that I built as a learning/make-my-life-easier project that uses
I have a quick question. I am learning how to make a registration form
I'm learning and trying to make a site but I'm a bit confused about
To make story short, i'm building self-learning banner management system. Users will be able
I'm learning Objective-C and trying to make a very simple command line calculator. 'S'
I am learning NodeJS and was able to make a server and an iPhone
I am learning GDI+ and I am trying to make a display window with

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.