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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:37:24+00:00 2026-06-04T21:37:24+00:00

FATAL EXCEPTION E/AndroidRuntime(535): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.This.Calculator/com.This.Calculator.BatteryCalculatorActivity}: java.lang.ClassNotFoundException: com.This.Calculator.ThisBatteryCalculatorActivity I was just

  • 0

FATAL EXCEPTION
E/AndroidRuntime(535): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.This.Calculator/com.This.Calculator.BatteryCalculatorActivity}: java.lang.ClassNotFoundException: com.This.Calculator.ThisBatteryCalculatorActivity

I was just following the tutorial of Android Developers for Tab View and I’d like to think that I followed it to the word… But it seems that I haven’t. Can someone please help me?
I’m using eclipse btw.

Here are my codes:

for the ThisBatteryCalculator

  package com.This.Calculator;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;



@SuppressWarnings("deprecation")
public class ThisBatteryCalculator extends TabActivity {
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Resources res = getResources(); // Resource object to get Durables
    TabHost tabHost = getTabHost();  // The activity TabHost
    TabHost.TabSpec spec;  // Reusable 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, ArtistsActivity.class);

    // Initialize a TabSpec for each tab and add it to the TabHost
    spec = tabHost.newTabSpec("artists").setIndicator("Artists",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);
    tabHost.addTab(spec);

    // Do the same for the other tabs
    intent = new Intent().setClass(this, AlbumsActivity.class);
    spec = tabHost.newTabSpec("albums").setIndicator("Albums",
                      res.getDrawable(R.drawable.ic_tab_albums))
                  .setContent(intent);
    tabHost.addTab(spec);

    intent = new Intent().setClass(this, SongActivity.class);
    spec = tabHost.newTabSpec("songs").setIndicator("Songs",
                      res.getDrawable(R.drawable.ic_tab_songs))
                  .setContent(intent);
    tabHost.addTab(spec);

    tabHost.setCurrentTab(2);
}
}

for my manifest:

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

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".ThisBatteryCalculatorActivity"          
        android:label="@string/app_name" >
        android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
 </activity>
        <activity android:name=".ArtistsActivity"
          android:label="@string/app_name" 
          android:theme="@android:style/Theme.NoTitleBar">
</activity>

<activity android:name=".SongActivity"
          android:label="@string/app_name" 
          android:theme="@android:style/Theme.NoTitleBar">
</activity>

<activity android:name=".AlbumsActivity"
          android:label="@string/app_name" 
          android:theme="@android:style/Theme.NoTitleBar">
</activity>

</application>



</manifest>

and finally for my main.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:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">
    <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"
        android:padding="5dp" />
</LinearLayout>
</TabHost>

Any help would be greatly appreciated! Thank you!

  • 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-04T21:37:26+00:00Added an answer on June 4, 2026 at 9:37 pm

    In your manifest, you have ThisBatteryCalculatorActivity as the name of the activity class.

    In your source code, you have ThisBatteryCalculator as the name of the activity class.

    ThisBatteryCalculatorActivity and ThisBatteryCalculator are not the same. They need to be the same. Which you choose is up to you. Either rename the class to ThisBatteryCalculatorActivity or adjust your manifest to refer to ThisBatteryCalculator.

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

Sidebar

Related Questions

The logcat error: 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): FATAL EXCEPTION: main 08-24 11:16:19.760: ERROR/AndroidRuntime(6254): java.lang.RuntimeException: Unable
12-07 11:25:34.290: E/AndroidRuntime(9177): FATAL EXCEPTION: AsyncTask #2 12-07 11:25:34.290: E/AndroidRuntime(9177): java.lang.RuntimeException: An error occured
E/AndroidRuntime(2886): FATAL EXCEPTION: main E/AndroidRuntime(2886): java.lang.NullPointerException E/AndroidRuntime(2886): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394) E/AndroidRuntime(2886): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) E/AndroidRuntime(2886): at
New to android programming. Getting Following error. 04-07 14:49:05.452: ERROR/AndroidRuntime(1566): FATAL EXCEPTION: main java.lang.OutOfMemoryError
E/AndroidRuntime(16172): FATAL EXCEPTION: main E/AndroidRuntime(16172): java.lang.IllegalArgumentException: no dialog with id 2 was ever shown
WARN/dalvikvm(4645): threadid=7: thread exiting with uncaught exception (group=0x4001d800) ERROR/AndroidRuntime(4645): FATAL EXCEPTION: Timer-0 ERROR/AndroidRuntime(4645): java.lang.RuntimeException:
I'm getting this exception from facebook SDK: Fatal error: Uncaught OAuthException: (#506) Duplicate status
Possible Duplicate: Android RuntimeException: Unable to instantiate the service Problem: starting an IntentService generates
Im not gettin the following error fixed (logcat): E/AndroidRuntime( 1010): FATAL EXCEPTION: Thread-105 E/AndroidRuntime(
Custom non-fatal exception derive from which class in asp.net 3.5?

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.