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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:18:19+00:00 2026-06-11T19:18:19+00:00

I am getting some errors when trying to run my android app on an

  • 0

I am getting some errors when trying to run my android app on an emulator that is running any version of Android 4.x but it works fine on any version of Android 2.X.

package com.EXCLUDED_FOR_PRIVACY.EXCLUDED_FOR_PRIVACY;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabSpec;
import android.widget.ImageView;
import android.graphics.Color;

public class EXCLUDED_FOR_PRIVACY extends Activity {

    public int WebView1Bool=0;
    public int WebView2Bool=0;
    public int WebView3Bool=0;
    public int WebView4Bool=0;
    private TabHost tabs;

    private void setupTabHost() {
        tabs = (TabHost) findViewById(R.id.my_tabhost);
        tabs.setup();
    }

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

        setupTabHost();
        tabs.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

        setupTab(new ImageView(this), 1);
        setupTab(new ImageView(this), 2);
        setupTab(new ImageView(this), 3);
        setupTab(new ImageView(this), 4);

        WebView mWebView1;
        mWebView1 = (WebView) findViewById(R.id.webview1);
        mWebView1.setBackgroundColor(Color.parseColor("#a3a3a3"));
        mWebView1.setBackgroundColor(0);
        mWebView1.getSettings().setJavaScriptEnabled(true);
        mWebView1.setWebViewClient(new MobileClient());
        mWebView1.loadUrl("EXCLUDED_FOR_PRIVACY");
        WebView1Bool=1;

        tabs.getTabWidget().getChildAt(0).setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){
                tabs.setCurrentTab(0);
                if(WebView1Bool==0){
                    WebView mWebView1;
                    mWebView1 = (WebView) findViewById(R.id.webview1);
                    mWebView1.setBackgroundColor(Color.parseColor("#a3a3a3"));
                    mWebView1.setBackgroundColor(0);
                    mWebView1.getSettings().setJavaScriptEnabled(true);
                    mWebView1.setWebViewClient(new MobileClient());
                    mWebView1.loadUrl("EXCLUDED_FOR_PRIVACY");
                    WebView1Bool=1;
                }
            }
        });

        tabs.getTabWidget().getChildAt(2).setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){
                tabs.setCurrentTab(1);
                if(WebView2Bool==0){
                    WebView mWebView2;
                    mWebView2 = (WebView) findViewById(R.id.webview2);
                    mWebView2.setBackgroundColor(Color.parseColor("#a3a3a3"));
                    mWebView2.setBackgroundColor(0);
                    mWebView2.getSettings().setJavaScriptEnabled(true);
                    mWebView2.setWebViewClient(new MobileClient());
                    mWebView2.loadUrl("EXCLUDED_FOR_PRIVACY");
                    WebView2Bool=1;
                }
            }
        });

        tabs.getTabWidget().getChildAt(4).setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){
                tabs.setCurrentTab(2);
                if(WebView3Bool==0){
                    WebView mWebView3 = (WebView) findViewById(R.id.webview3);
                    mWebView3.setBackgroundColor(Color.parseColor("#a3a3a3"));
                    mWebView3.setBackgroundColor(0);
                    mWebView3.getSettings().setJavaScriptEnabled(true);
                    mWebView3.setWebViewClient(new MobileClient());
                    mWebView3.loadUrl("EXCLUDED_FOR_PRIVACY");
                    WebView3Bool=1;
                }
            }
        });

        tabs.getTabWidget().getChildAt(6).setOnClickListener(new OnClickListener(){
            @Override
            public void onClick(View v){
                tabs.setCurrentTab(3);
                if(WebView4Bool==0){
                    WebView mWebView4;
                    mWebView4 = (WebView) findViewById(R.id.webview4);
                    mWebView4.setBackgroundColor(Color.parseColor("#a3a3a3"));
                    mWebView4.setBackgroundColor(0);
                    mWebView4.getSettings().setJavaScriptEnabled(true);
                    mWebView4.setWebViewClient(new MobileClient());
                    mWebView4.loadUrl("EXCLUDED_FOR_PRIVACY");
                    WebView4Bool=1;
                }
            }
        });
    }

    private class MobileClient extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            view.loadUrl(url);
            return true;
        }
    }

    private void setupTab(final View view, final int i) {
        View createTabView_view = LayoutInflater.from(tabs.getContext()).inflate(R.layout.tabs_bg, null);
        ImageView createTabView_tv = (ImageView) createTabView_view.findViewById(R.id.tabsImage);
        if(i==1){
            TabSpec tabSpec = tabs.newTabSpec("EXCLUDED_FOR_PRIVACY");
            createTabView_tv.setImageResource(R.drawable.ic_discounts);
            tabSpec.setIndicator(createTabView_view);
            tabSpec.setContent(R.id.webview1);
            tabs.addTab(tabSpec);
        } else if(i==2){
            TabSpec tabSpec = tabs.newTabSpec("EXCLUDED_FOR_PRIVACY");
            createTabView_tv.setImageResource(R.drawable.ic_specials);
            tabSpec.setIndicator(createTabView_view);
            tabSpec.setContent(R.id.webview2);
            tabs.addTab(tabSpec);
        } else if(i==3){
            TabSpec tabSpec = tabs.newTabSpec("EXCLUDED_FOR_PRIVACY");
            createTabView_tv.setImageResource(R.drawable.ic_directory);
            tabSpec.setIndicator(createTabView_view);
            tabSpec.setContent(R.id.webview3);
            tabs.addTab(tabSpec);
        } else if(i==4){
            TabSpec tabSpec = tabs.newTabSpec("EXCLUDED_FOR_PRIVACY");
            createTabView_tv.setImageResource(R.drawable.ic_membership);
            tabSpec.setIndicator(createTabView_view);
            tabSpec.setContent(R.id.webview4);
            tabs.addTab(tabSpec);
        }
    }
}

Here are the errors I am seeing

09-24 13:11:25.329: E/Trace(1151):              error opening trace file: No such file or directory (2)
09-24 13:11:25.539: D/dalvikvm(1151):           GC_FOR_ALLOC freed 43K, 4% free 8316K/8583K, paused 42ms, total 45ms
09-24 13:11:25.549: I/dalvikvm-heap(1151):      Grow heap (frag case) to 8.829MB for 691216-byte allocation
09-24 13:11:25.669: D/dalvikvm(1151):           GC_CONCURRENT freed <1K, 4% free 8990K/9287K, paused 75ms+6ms, total 124ms
09-24 13:11:25.829: D/gralloc_goldfish(1151):   Emulator without GPU emulation detected.
09-24 13:11:26.209: I/Choreographer(1151):      Skipped 42 frames!  The application may be doing too much work on its main thread.
09-24 13:11:26.379: I/Choreographer(1151):      Skipped 44 frames!  The application may be doing too much work on its main thread.
09-24 13:11:27.509: I/Choreographer(1151):      Skipped 54 frames!  The application may be doing too much work on its main thread.
09-24 13:11:28.319: D/AndroidRuntime(1151):     Shutting down VM
09-24 13:11:28.319: W/dalvikvm(1151):           threadid=1: thread exiting with uncaught exception (group=0x40a13300)
09-24 13:11:28.379: E/AndroidRuntime(1151):     FATAL EXCEPTION: main
09-24 13:11:28.379: E/AndroidRuntime(1151):     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.EXCLUDED.EXCLUDED/com.EXCLUDED.EXCLUDED.EXCLUDED}: java.lang.NullPointerException
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.os.Looper.loop(Looper.java:137)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread.main(ActivityThread.java:4745)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at java.lang.reflect.Method.invokeNative(Native Method)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at java.lang.reflect.Method.invoke(Method.java:511)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at dalvik.system.NativeStart.main(Native Method)
09-24 13:11:28.379: E/AndroidRuntime(1151):     Caused by: java.lang.NullPointerException
09-24 13:11:28.379: E/AndroidRuntime(1151):     at com.EXCLUDED.EXCLUDED.EXCLUDED.onCreate(EXCLUDED.java:85)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.Activity.performCreate(Activity.java:5008)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
09-24 13:11:28.379: E/AndroidRuntime(1151):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
09-24 13:11:28.379: E/AndroidRuntime(1151):     ... 11 more
09-24 13:11:30.289: I/Process(1151):            Sending signal. PID: 1151 SIG: 9

I apologize if this is something really simple that any java developer would know, I have to admit I barely know what I am doing in Java but am under the gun to get this built. Thank you very much for any 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-11T19:18:20+00:00Added an answer on June 11, 2026 at 7:18 pm

    Get rid of all the tabs.getTabWidget().getChildAt(...).setOnClickListener() crap, replacing it with a single TabHost.OnTabChangeListener that you register with your TabHost, to find out when the user changes tabs. Your existing code assumes a particular internal structure of a TabWidget, and that assumption is unreliable, as you are discovering.

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

Sidebar

Related Questions

I'm trying to rename some files, but getting a baffling error*. When I run
I am getting some errors when trying to run yuicompressor. it says: [error] 1:2:illegal
I am getting some errors when I am trying to run the hellogridview from
I am trying to port an iPhone App to Android, but am having some
My issue is simply that I am getting errors when trying to run a
I'm trying to code some stuff for a game but I keep getting error
I published an app 2 moths ago and sometimes, I am getting some errors
Im a getting errors from some code developed in Java that want to use
Trying to update some repositories on Debian Etch installation and getting the following errors
We've just started getting some errors when trying to publish pages (.NET) - in

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.