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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:30:01+00:00 2026-06-10T11:30:01+00:00

I’m building an application implementing Bluetooth , Wifi , Phone call and Sms using

  • 0

I’m building an application implementing Bluetooth , Wifi , Phone call and Sms using tabs . The MainActivity.java file is shown below .

package com.example.servicesdemo;

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

public class MainActivity extends TabActivity {

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

    TabSpec btspec = tabHost.newTabSpec("Bluetooth");
    btspec.setIndicator("Bluetooth");
    Intent btIntent = new Intent(getBaseContext() , BtActivity.class);
    btspec.setContent(btIntent);

    TabSpec wifispec = tabHost.newTabSpec("Wifi");
    wifispec.setIndicator("Wifi");
    Intent wifiIntent = new Intent(getBaseContext(),WifiActivity.class);
    wifispec.setContent(wifiIntent);

    TabSpec callspec = tabHost.newTabSpec("Phone Call");
    callspec.setIndicator("Phone Call");
    Intent callIntent = new Intent(getBaseContext(),CallActivity.class);
    wifispec.setContent(callIntent);

    TabSpec smsspec = tabHost.newTabSpec("SMS");
    wifispec.setIndicator("SMS");
    Intent smsIntent = new Intent(getBaseContext(),SmsActivity.class);
    smsspec.setContent(smsIntent);

    tabHost.addTab(btspec);
    tabHost.addTab(wifispec);
    tabHost.addTab(callspec);

    tabHost.addTab(smsspec);
    tabHost.setCurrentTab(0);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}


}

I’ve created 4 XML files and 4 Activity files (one for each service mentioned above) . For exmaple , I’ve created a BtActivity.java file for the bluetooth tab , as shown below (I’ll be writing more code later on) .

BtActivity.java

package com.example.servicesdemo;

import android.app.Activity;
import android.os.Bundle;

public class BtActivity extends Activity{
public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bt_layout);
}

}

Now when I try to run the application it simply crashes . The LogCat error is shown below .

     08-29 10:44:33.810: D/AndroidRuntime(369): Shutting down VM
08-29 10:44:33.810: W/dalvikvm(369): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-29 10:44:33.830: E/AndroidRuntime(369): FATAL EXCEPTION: main
08-29 10:44:33.830: E/AndroidRuntime(369): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.servicesdemo/com.example.servicesdemo.MainActivity}: java.lang.IllegalArgumentException: you must specify a way to create the tab content
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.os.Looper.loop(Looper.java:130)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread.main(ActivityThread.java:3683)
08-29 10:44:33.830: E/AndroidRuntime(369):  at java.lang.reflect.Method.invokeNative(Native Method)
08-29 10:44:33.830: E/AndroidRuntime(369):  at java.lang.reflect.Method.invoke(Method.java:507)
08-29 10:44:33.830: E/AndroidRuntime(369):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-29 10:44:33.830: E/AndroidRuntime(369):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-29 10:44:33.830: E/AndroidRuntime(369):  at dalvik.system.NativeStart.main(Native Method)
08-29 10:44:33.830: E/AndroidRuntime(369): Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab content
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.widget.TabHost.addTab(TabHost.java:202)
08-29 10:44:33.830: E/AndroidRuntime(369):  at com.example.servicesdemo.MainActivity.onCreate(MainActivity.java:43)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-29 10:44:33.830: E/AndroidRuntime(369):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-29 10:44:33.830: E/AndroidRuntime(369):  ... 11 more
08-29 10:49:53.781: D/AndroidRuntime(378): Shutting down VM
08-29 10:49:53.781: W/dalvikvm(378): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-29 10:49:53.790: E/AndroidRuntime(378): FATAL EXCEPTION: main
08-29 10:49:53.790: E/AndroidRuntime(378): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.servicesdemo/com.example.servicesdemo.MainActivity}: java.lang.IllegalArgumentException: you must specify a way to create the tab content
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.os.Looper.loop(Looper.java:130)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread.main(ActivityThread.java:3683)
08-29 10:49:53.790: E/AndroidRuntime(378):  at java.lang.reflect.Method.invokeNative(Native Method)
08-29 10:49:53.790: E/AndroidRuntime(378):  at java.lang.reflect.Method.invoke(Method.java:507)
08-29 10:49:53.790: E/AndroidRuntime(378):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-29 10:49:53.790: E/AndroidRuntime(378):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-29 10:49:53.790: E/AndroidRuntime(378):  at dalvik.system.NativeStart.main(Native Method)
08-29 10:49:53.790: E/AndroidRuntime(378): Caused by: java.lang.IllegalArgumentException: you must specify a way to create the tab content
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.widget.TabHost.addTab(TabHost.java:202)
08-29 10:49:53.790: E/AndroidRuntime(378):  at com.example.servicesdemo.MainActivity.onCreate(MainActivity.java:43)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-29 10:49:53.790: E/AndroidRuntime(378):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
08-29 10:49:53.790: E/AndroidRuntime(378):  ... 11 more
08-29 10:49:56.110: I/Process(378): Sending signal. PID: 378 SIG: 9

I’ve encountered a similar problem before but in that case one of the class which I was trying to display in a tab did not extend the Activity class (That was what I was told about by the users) .

Here’s a link to my previous question for reference .

But now , I’ve used all classes extending the Activity class , so there should be no problem during runtime . Please help

  • 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-10T11:30:03+00:00Added an answer on June 10, 2026 at 11:30 am

    you have used wifispec.setContent(); for Phone Call use callspec.setContent(callIntent); etc.

    TabSpec callspec = tabHost.newTabSpec("Phone Call");
        **callspec.setIndicator("Phone Call");** 
        Intent callIntent = new Intent(getBaseContext(),CallActivity.class);
        **wifispec.setContent(callIntent);**  ---> callspec.setContent(callIntent);
    
        TabSpec smsspec = tabHost.newTabSpec("SMS");
        **wifispec.setIndicator("SMS");**  ---> smsspec.setIndicator("SMS");
        Intent smsIntent = new Intent(getBaseContext(),SmsActivity.class);
        **smsspec.setContent(smsIntent);**   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

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.