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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:24:05+00:00 2026-06-06T20:24:05+00:00

I have an app that crashes if i press the home button, back button

  • 0

I have an app that crashes if i press the home button,

back button goes fine to the dashboard, but if I press home it crashes with:

07-02 16:50:51.834: E/AndroidRuntime(343): java.lang.RuntimeException:
Unable to pause activity
{com.rt.paging/com.rt.paging.MKpagerActivity}:
java.lang.NullPointerException

this is my code

public class MKpagerActivity extends FragmentActivity {

    private PagerAdapter mPagerAdapter;


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

      //initialsie the pager
            this.initialisePaging(); //crea un metodo! y lo implementa abajo!
    }

    /**
     * Initialise the fragments to be paged
     */
    private void initialisePaging() {

        List<Fragment> fragments = new Vector<Fragment>();
        fragments.add(Fragment.instantiate(this, Fragmen1.class.getName()));
        fragments.add(Fragment.instantiate(this, Fragmen2.class.getName()));
        this.mPagerAdapter  = new com.orchard.paging.PagerAdapter(super.getSupportFragmentManager(), fragments); //por que hay q decirle el paquete??


        //
        ViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);
        pager.setAdapter(this.mPagerAdapter);

    }


    @Override
    public void onSaveInstanceState(Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);
        // your stuff or nothing
    }

    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        // your stuff or nothing
    }



}

this is my logCat

07-02 17:15:11.545: E/AndroidRuntime(327): FATAL EXCEPTION: main
07-02 17:15:11.545: E/AndroidRuntime(327): java.lang.RuntimeException: Unable to pause activity {com.orchard.paging/com.orchard.paging.MKpagerActivity}: java.lang.NullPointerException
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2354)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2311)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2291)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.access$1700(ActivityThread.java:117)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:938)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.os.Looper.loop(Looper.java:123)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.main(ActivityThread.java:3683)
07-02 17:15:11.545: E/AndroidRuntime(327):  at java.lang.reflect.Method.invokeNative(Native Method)
07-02 17:15:11.545: E/AndroidRuntime(327):  at java.lang.reflect.Method.invoke(Method.java:507)
07-02 17:15:11.545: E/AndroidRuntime(327):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-02 17:15:11.545: E/AndroidRuntime(327):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-02 17:15:11.545: E/AndroidRuntime(327):  at dalvik.system.NativeStart.main(Native Method)
07-02 17:15:11.545: E/AndroidRuntime(327): Caused by: java.lang.NullPointerException
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.support.v4.app.FragmentManagerImpl.saveFragmentBasicState(FragmentManager.java:1576)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.support.v4.app.FragmentManagerImpl.saveAllState(FragmentManager.java:1617)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:481)
07-02 17:15:11.545: E/AndroidRuntime(327):  at com.orchard.paging.MKpagerActivity.onSaveInstanceState(MKpagerActivity.java:50)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.Activity.performSaveInstanceState(Activity.java:1037)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1181)
07-02 17:15:11.545: E/AndroidRuntime(327):  at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2336)
07-02 17:15:11.545: E/AndroidRuntime(327):  ... 12 more

So, what Im I missing?, why the crash?

How to read what line is the offender bit of code?

thanks!

  • 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-06T20:24:07+00:00Added an answer on June 6, 2026 at 8:24 pm

    The problem is of the JAR file , you will need to do changes in that, or will have to get download the updated version of the jar file.

    You can have a look at this answer to understand more.

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

Sidebar

Related Questions

I have an app that crashes and freezes, I pressed home button to get
I have put a button over a toolbar.But when i press that button,my selector
have an app that finds your GPS location successfully, but I need to be
I have an App that downloads and displays images from URL's. This works fine
I have a Windows C++ app that crashes on user computers from time to
I have an app that appears to work fine on an android 2.3.5 phone,
When i press my button the app crashes. Happens even when I create the
I have an app that only crashes for one of my tester’s - no
I have an app that I want to distribute to 3.1.x devices, but I
I have an app that presents a Show Route button (between present location, and

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.