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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:03:24+00:00 2026-06-16T01:03:24+00:00

after changing activites on my application sometimes i get an exception and i don’t

  • 0

after changing activites on my application sometimes i get an exception and i don’t know what can be the problem.
This exception occour not in the same activities (but random) and in different function called.

This is the stack:

12-11 10:48:34.677: E/AndroidRuntime(479): FATAL EXCEPTION: main
12-11 10:48:34.677: E/AndroidRuntime(479): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.apia.selfnettest/com.apia.selfnettest.TabPayments}: java.lang.NullPointerException
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.os.Looper.loop(Looper.java:130)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread.main(ActivityThread.java:3683)
12-11 10:48:34.677: E/AndroidRuntime(479):  at java.lang.reflect.Method.invokeNative(Native Method)
12-11 10:48:34.677: E/AndroidRuntime(479):  at java.lang.reflect.Method.invoke(Method.java:507)
12-11 10:48:34.677: E/AndroidRuntime(479):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-11 10:48:34.677: E/AndroidRuntime(479):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-11 10:48:34.677: E/AndroidRuntime(479):  at dalvik.system.NativeStart.main(Native Method)
12-11 10:48:34.677: E/AndroidRuntime(479): Caused by: java.lang.NullPointerException
12-11 10:48:34.677: E/AndroidRuntime(479):  at com.apia.utils.LibLayout.setDisplayMenuContent(LibLayout.java:557)
12-11 10:48:34.677: E/AndroidRuntime(479):  at com.apia.selfnettest.TabPayments.onCreate(TabPayments.java:167)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-11 10:48:34.677: E/AndroidRuntime(479):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
12-11 10:48:34.677: E/AndroidRuntime(479):  ... 11 more

It seems that sometimes, the activities cannot draw some resources or open raw files…
thank you…

here the code of “setDisplayMenuContent”:

public static void setDisplayMenuContent(ArrayList<?> localTabMenu_records, Display display, 
        Activity myactivity, int myId, int BtnResId ) {

    int width = display.getWidth(); 
    int height = display.getHeight(); 
    int N_Tab=3;
    Button btnSelButton = null;
    Button btnUnSelButton = null;

    int Ntab= Math.min(N_Tab, 4);

    if (Ntab>0)
    {


        Button btn1 = null;
        Button btn12= null;
        Button btn2= null;
        Button btn22= null;
        Button btn3= null;  
        Button btn32 = null;
        Button btn0off= null;
        Button btn00off= null;
        Button btn1off= null;
        Button btn11off= null;
        Button btn2off= null;
        Button btn22off= null;


        if (LibController.appLogged) {
            /*ONLINE*/
            btn1 = (Button) myactivity.findViewById(R.id.menu1);
            btn12 = (Button) myactivity.findViewById(R.id.menu12);
            btn2 = (Button) myactivity.findViewById(R.id.menu2);
            btn22 = (Button) myactivity.findViewById(R.id.menu22);
            btn3 = (Button) myactivity.findViewById(R.id.menu3);    
            btn32 = (Button) myactivity.findViewById(R.id.menu32); 
        }else{
            /*OFFLINE*/
            btn0off = (Button) myactivity.findViewById(R.id.menu0off);
            btn00off = (Button) myactivity.findViewById(R.id.menu00off);
            btn1off = (Button) myactivity.findViewById(R.id.menu1off);
            btn11off = (Button) myactivity.findViewById(R.id.menu11off);
            btn2off = (Button) myactivity.findViewById(R.id.menu2off);
            btn22off = (Button) myactivity.findViewById(R.id.menu22off);

        }

        if(localTabMenu_records != null && localTabMenu_records.size() > 0){
            for(int i=0; i<localTabMenu_records.size();i++){    
                RecordTabMenu myRec = (RecordTabMenu) localTabMenu_records.get(i);

                if (LibController.appLogged) {
                    // *********** ONLINE ************  
                    if (myRec.getIdTab().equals("TabWelcome")) 
                    {
                        if (BtnResId == R.id.menu1) {
                            btnSelButton=btn1;
                            btnUnSelButton=btn12;
                        }
                        else {
                            btnSelButton=btn12;
                            btnUnSelButton=btn1;
                        }
                    }
                    else if (myRec.getIdTab().equals("TabAccount"))
                    {
                        if (BtnResId == R.id.menu2) {
                            btnSelButton=btn2;
                            btnUnSelButton=btn22;
                        }
                        else {
                            btnSelButton=btn22;
                            btnUnSelButton=btn2;
                        }
                    }
                    else if (myRec.getIdTab().equals("TabPayments"))
                    {
                        if (BtnResId == R.id.menu3) {
                            btnSelButton=btn3;
                            btnUnSelButton=btn32;
                        }
                        else {
                            btnSelButton=btn32;
                            btnUnSelButton=btn3;
                        }       
                    }    

                }else {

                    // *********** OFFLINE ************
                    if(myRec.getIdTab().equals("TabMainClass"))
                    {
                        if (BtnResId == R.id.menu0off) {
                            btnSelButton=btn0off;
                            btnUnSelButton=btn00off;
                        }
                        else {
                            btnSelButton=btn00off;
                            btnUnSelButton=btn0off;
                        }
                    }
                    else if (myRec.getIdTab().equals("TabContact")) 
                    {
                        if (BtnResId == R.id.menu1off) {
                            btnSelButton=btn1off;
                            btnUnSelButton=btn11off;
                        }
                        else {
                            btnSelButton=btn11off;
                            btnUnSelButton=btn1off;
                        }
                    }else if (myRec.getIdTab().equals("TabInfo"))   
                    {
                        if (BtnResId == R.id.menu2off) {
                            btnSelButton=btn2off;
                            btnUnSelButton=btn22off;
                        }
                        else {
                            btnSelButton=btn22off;
                            btnUnSelButton=btn2off;
                        }
                    }
                }

                String myCaptio = myRec.getTitleTab();
                setButtonPropertiesForLayout(myactivity, i, btnSelButton, height, width, Ntab , myCaptio);

                if (btnUnSelButton != null) {
                    btnUnSelButton.getLayoutParams().width = 0;  // INVISIBLE
                }

            };
        }       

    }


    Button myBtn = (Button) myactivity.findViewById(BtnResId);
    myBtn.setBackgroundResource(R.drawable.menusel);
}
  • 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-16T01:03:26+00:00Added an answer on June 16, 2026 at 1:03 am

    The activity Activity myactivit does not contains resource with id BtnResId.

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

Sidebar

Related Questions

I've got the following problem. After starting, application works fine - even after changing
After changing the import as a from-import i'm running into this error: from datetime
Can anyone confirm that after changing the Apple Push Certificate to follow the new
After adding a second persistence unit and changing my application's data sources to XADataSource
I followed this tutorial on changing the name of my Android Application by changing
After changing a menu from a regular select to a jQuery selectmenu, I can
After changing - #import <Cocoa/Cocoa.h> to #import <UIKit/UIKit.h> - pi to M_PI and disabling
After changing the text in a tab control's tab header, how do I tell
I've found that after changing the overlays on a MapView , the changes aren't
How do you detect the current SCAN state and revert it after changing it?

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.