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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:54:50+00:00 2026-05-28T07:54:50+00:00

Why is there an error in my code? I’m calling two classes in same

  • 0

Why is there an error in my code? I’m calling two classes in same package. one is the “BatteryInformation.java” which extends Activity and its function is to get the Battery Info, the next one is “TaskKiller.java” which extends Activity also and its function is to kill running application. This two class has no error and i run it without this UI and it works well. can you please help me?

public class BatteryDoctorSaverActivity extends Activity {
    TabHost tabHost;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

         tabHost = (TabHost) findViewById(R.id.tabhost);

        // Resources res = getResources(); // Resource object to get Drawables
        TabHost.TabSpec spec; // Resusable TabSpec for each tab
        Intent intent; // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, BatteryInformation.class);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("Battery Information").setIndicator("")
                .setContent(intent);
        tabHost.addTab(spec);

        // Do the same for the other tabs
        intent = new Intent().setClass(this, TaskKiller.class);
        spec = tabHost.newTabSpec("Task Killer").setIndicator("TaskKiller")
                .setContent(intent);
        tabHost.addTab(spec);
            tabHost.setCurrentTab(0);

    }
}

And here is the LogCat:

01-23 10:30:55.949: D/AndroidRuntime(12278): Shutting down VM
01-23 10:30:55.949: W/dalvikvm(12278): threadid=1: thread exiting with uncaught exception (group=0x40018578)
01-23 10:30:55.949: E/AndroidRuntime(12278): FATAL EXCEPTION: main
01-23 10:30:55.949: E/AndroidRuntime(12278): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=batterydoctorsaver.thesis.BatteryInformation }
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.app.Activity.startActivityForResult(Activity.java:2827)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.app.Activity.startActivity(Activity.java:2933)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at batterydoctorsaver.thesis.BatteryDoctorSaverActivity$1.onClick(BatteryDoctorSaverActivity.java:22)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.view.View.performClick(View.java:2485)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.view.View$PerformClick.run(View.java:9080)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.os.Handler.handleCallback(Handler.java:587)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.os.Handler.dispatchMessage(Handler.java:92)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.os.Looper.loop(Looper.java:130)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at android.app.ActivityThread.main(ActivityThread.java:3687)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at java.lang.reflect.Method.invokeNative(Native Method)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at java.lang.reflect.Method.invoke(Method.java:507)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-23 10:30:55.949: E/AndroidRuntime(12278):    at dalvik.system.NativeStart.main(Native Method)

can anyone help me with this. I’m stack with this UI for almost 2days. i didn’t know what to do. please help me. THANKS FOR THE HELP 🙂

@Lucifer Here is my AndroidManifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="batterydoctorsaver.thesis"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".BatteryDoctorSaverActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <activity
        android:label="@string/app_name"
        android:name=".BatteryInformation" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

    <!-- <activity android:name = ".BatteryInformation"/> -->

</manifest>

@Lucifer here sir:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="batterydoctorsaver.thesis"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".BatteryDoctorSaverActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".BatteryInformation" />
        <activity android:name=".TaskKiller" />
    </application>

</manifest>

and here is my code in may BatterDoctorSaverActivity.java:

package batterydoctorsaver.thesis;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import batterydoctorsaver.thesis.BatteryInformation;
import batterydoctorsaver.thesis.TaskKiller;

public class BatteryDoctorSaverActivity extends TabActivity {
    TabHost tabHost;

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

        tabHost = getTabHost();
        tabHost.setup();
        tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("Battery Information")
                .setContent(new Intent(this, BatteryInformation.class)));
        tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("Task Killer")
                .setContent(new Intent(this, TaskKiller.class)));

        // tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("Updates").setContent(
        // new Intent(this, DownloadList.class)));

    }
}
  • 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-28T07:54:51+00:00Added an answer on May 28, 2026 at 7:54 am

    You need to add your activity to your AndroidManifest.xml file. All the activity must have an entry to that file.

    remove this lines from your code,

    <activity
            android:label="@string/app_name"
            android:name=".BatteryInformation" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    

    instead use following lines.

    <activity> android:name=.BatteryInformation />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below is resulting in an error on a site in which there
I'm having a little trouble organizing my error messages for two interacting classes. One
If I get an error code result from a Cocoa function, is there any
The following line of code generates the compile time error (PE19) There is no
With the following code below, There is an error saying File /home/user/web_pro/info/views.py, line 184,
Is there a good way to debug exited with code 5 runtime error on
Say you have an enum that represents an error code. There will be several
how to catch sql exception with its error code(error no) to identify which exception
Calling system() to run an external .exe and checking error code upon errors: #include
Is there an error in this code SHOW PROCEDURE CODE proc_name ? The MySQL

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.