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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:50:17+00:00 2026-06-10T19:50:17+00:00

I got this error message: 09-05 19:58:00.883: E/AndroidRuntime(21920): java.lang.RuntimeException: Unable to pause activity {com.De7kat.Grid/com.De7kat.Grid.De7katGrid}:

  • 0

I got this error message:

09-05 19:58:00.883: E/AndroidRuntime(21920): java.lang.RuntimeException: Unable to pause      activity {com.De7kat.Grid/com.De7kat.Grid.De7katGrid}: java.lang.NullPointerException

when I go to activity 2 and try to back to activity 1 by clicking the back button on device.

de7katgrid activity code is:

package com.De7kat.Grid;


public class De7katGrid extends Activity {
private MediaPlayer mp;
public Integer[] mSongsIds = {
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,R.raw.far,
        R.raw.beet,    };
public Object getItem(int position) {
    return mSongsIds[position];
}
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.grid_layout);

    GridView gridView = (GridView) findViewById(R.id.grid_view);

    // Instance of ImageAdapter Class
    gridView.setAdapter(new ImageAdapter(this));

    gridView.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View v,
                int position, long id) {
             stopPlaying();
             mp = MediaPlayer.create(De7katGrid.this,mSongsIds[position]);
             mp.start();

           }
    });
}
@Override
public void onPause() {
    super.onPause();
    if (mp.isPlaying()) {
       mp.stop();



    }
}

    private void stopPlaying() {
        if (mp != null) {
            mp.stop();
            mp.release();
            mp = null;


       }
    }
 }
  • 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-10T19:50:18+00:00Added an answer on June 10, 2026 at 7:50 pm

    When you return to your Activity mp is null after you call create() because you failed to release the previous one. Change your onPause() method like so:

    @Override
    public void onPause() {
        super.onPause();
        stopPlaying();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got this error in the logcat 06-21 11:58:27.275: E/AndroidRuntime(404): java.lang.RuntimeException: Unable to start
I'm trying to parse the following URI : http://translate.google.com/#zh-CN|en|你 but got this error message
I got this error message : java.net.URISyntaxException: Illegal character in query at index 31:
Got this error message while trying to load view: The model item passed into
Got this error message while trying to configure an entitydatasource in the designer: My
I got this error message and I'm not quite sure whats wrong: Exception in
I got this error from XCode: objc[8422]: FREED(id): message release sent to freed object=0x3b120c0
I got error when I write this code @Html.X().ResourceManager() in view error message :
I got this error message Connection - Could not find SBO that match the
When i run my spring junit test i got this error message : Caused

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.