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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:21:51+00:00 2026-05-26T22:21:51+00:00

Problems with the TabActivity… I get this Exception java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1816) at android.app.ActivityThread.startActivityNow(ActivityThread.java:1651) at

  • 0

Problems with the TabActivity…

I get this Exception

    java.lang.NullPointerException
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1816)
    at android.app.ActivityThread.startActivityNow(ActivityThread.java:1651)
    at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
    at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
    at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:656)
    at android.widget.TabHost.setCurrentTab(TabHost.java:326)
    at android.widget.TabHost.addTab(TabHost.java:216)
    at home.android.yahtzee.activities.GameActivity.onCreate(GameActivity.java:36)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
    at android.app.ActivityThread.access$1500(ActivityThread.java:132)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:143)
    at android.app.ActivityThread.main(ActivityThread.java:4196)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)

with this code

public class GameActivity extends TabActivity {

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.tab_handler);

        Gson gson = new Gson();
        Player player = WhoIsPlayingDialog.playerSelected;
        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();
        tabHost.setup();
        tabHost.setTag(this);
        TabHost.TabSpec spec = tabHost.newTabSpec(player.getName());
        Intent intent = new Intent(GameActivity.this, GamePlayerActivity.class);
        intent.putExtra("player", gson.toJson(player));
        spec.setContent(intent);
        spec.setIndicator(player.getName(), res.getDrawable(player.getDroid()));
        tabHost.addTab(spec); <============ Line 36.
    }
}

And I do not know why. Can anyone tell me?

  • 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-26T22:21:51+00:00Added an answer on May 26, 2026 at 10:21 pm

    First, you do not need to call tabHost.setup() when you have already called getTabHost().

    Second, you likely get NullPointerException because either res.getDrawable(player.getDroid()) or player.getName() returns null.

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

Sidebar

Related Questions

I implement a TabActivity exactly like this - http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/ Now the problem is, I
I have an android app that extends a MapActivity, so I can't extend TabActivity.
any problems with doing this? int i = new StreamReader(file.txt).ReadToEnd().Split(new char[] {'\n'}).Length
well, I have my Android app that have 4 main options. For that I
Okay, so i am making an android app that has tabs, now my problem
My Android app is created with a tab bar and the root activity is
My Android app need the user to create an account to be able to
I have a problem: Java Code public class VisualizzaListaActivity extends TabActivity { /** Called
I have this error: 12-07 15:27:11.567: E/AndroidRuntime(15797): Caused by: android.database.sqlite.SQLiteException: no such column: recipient:
I have a TabActivity that I am having problems after the device changes orientation.

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.