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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:28:46+00:00 2026-06-06T14:28:46+00:00

I am a newbie to android development and am trying to develop a simple

  • 0

I am a newbie to android development and am trying to develop a simple application where a button is used to play a sound. I am trying to use SoundPool and find that every tutorial gives such a code to be added after making a soundpool object:

soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
            @Override
            public void onLoadComplete(SoundPool soundPool, int sampleId,
                    int status) {
                loaded = true;
            }
        });

but when i try to use this code in eclipse, it says

The method onLoadComplete(SoundPool, int, int) of type new SoundPool.OnLoadCompleteListener(){} must override a superclass method.
and suggests to remove the @override notation. This should happen if there is no such method?? Why am i getting this error?

and when i put soundID = soundPool.load(this, R.raw.mysound, 1);

after the above code, eclipse says The method load(Context, int, int) in the type SoundPool is not applicable for the arguments (new View.OnClickListener(){}, int, int)

this is my entire code:
public class FirstActivity extends Activity {
/** Called when the activity is first created. */

private SoundPool soundPool;
int soundID;
boolean loaded = false;

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

    Button bPlay = (Button) findViewById(R.id.bPlay);
    final TextView aRing = (TextView)findViewById(R.id.tAlarmRinging);

    bPlay.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            aRing.setVisibility(View.VISIBLE);

            soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
                @Override
                public void onLoadComplete(SoundPool soundPool, int sampleId,
                        int status) {
                    loaded = true;
                }
            });
            soundID = soundPool.load(this, R.raw.mysound, 1);
        }

        });
}

}

  • 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-06T14:28:48+00:00Added an answer on June 6, 2026 at 2:28 pm

    You should try to set the project compliance level to java 1.7 or something like this.

    Right click the project, goto Properties->Java Compiler->Check the Enable project specific settings->then select the highest compiler compliance level.

    If this doesn’t work, then right click the project, AndroidTools->Fix project properties.

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

Sidebar

Related Questions

I'm a newbie android developer, I'm trying to develop an application; a background service
Hi am newbie to android development. I had created one application where i need
Everyone, I am a newbie to android development. Now I have a question that
I am newbie in android. I developed an android application that shows 15 tabs.
I am newbie in android. I had planned to develop an application which divides
As a newbie to Android development, I'm trying to do the basics and build
I am newbie to android game development. I've been trying an example of game
I am a newbie android developer and I am trying to design a simple
I'm rather newbie on Android, and I'm working on a simple application to get
I am a newbie to Android development and was using PhoneGap to develop a

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.