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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:46:21+00:00 2026-06-12T10:46:21+00:00

In my android application I want to play mp3 tone while it loads the

  • 0

In my android application I want to play mp3 tone while it loads the splash activity.I have already finished my animated splash activity.here is my code .please someone help me to playing mp3 tone .

package com.bni.www;

 import android.app.Activity;
 import android.content.Intent;
 import android.graphics.PixelFormat;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.view.Window;
 import android.view.WindowManager;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.widget.ImageView;
 import android.widget.LinearLayout;


public class Main extends Activity {



 public void onAttachedToWindow() {
     super.onAttachedToWindow();
     Window window = getWindow();
     window.setFormat(PixelFormat.RGBA_8888);
    }


   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

 setContentView(R.layout.spalsh);
 CountDown _tik;
 _tik=new CountDown(12000,100,this,Login.class);
 //Intent intent=new Intent(Main.this,Login.class);   
 _tik.start();
 StartAnimations();
 //startActivity(intent);
}
  private void StartAnimations() {
 Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
 anim.reset();
 LinearLayout l=(LinearLayout) findViewById(R.id.lin_lay);
 l.clearAnimation();
 l.startAnimation(anim);

 anim = AnimationUtils.loadAnimation(this, R.anim.translate);
 anim.reset();
 ImageView iv = (ImageView) findViewById(R.id.logo);
 iv.clearAnimation();
 iv.startAnimation(anim);

   }



 }


 class CountDown extends CountDownTimer{
 private Activity _act;
 private Class _cls;
 public CountDown(long millisInFuture, long countDownInterval,Activity act,Class cls) {
 super(millisInFuture, countDownInterval);
 _act=act;
 _cls=cls;
 }
 @Override
 public void onFinish() {
 _act.startActivity(new Intent(_act,_cls));
 _act.finish();
 }
@Override
public void onTick(long millisUntilFinished) {

 }
}
  • 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-12T10:46:22+00:00Added an answer on June 12, 2026 at 10:46 am

    Use this code to play audio.

    mp = MediaPlayer.create(yourclassname.this, R.raw.mysound);
                            mp.setOnCompletionListener(new OnCompletionListener() {
    
                                @Override
                                public void onCompletion(MediaPlayer mp) {
                                    // TODO Auto-generated method stub
                                    mp.release();
                                }
    
                            });   
                            mp.start();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to play an mp3 file in my android application
I have an Android application with a Spinner and want to fill it dynamically
I have PhoneGap-Android application and I want to check network connection type (No connection,
I want to access an online music library from my android application to play
I'm writing an android application using eclipse. I have a main activity called MenuActivity
I am working with android application where I want play audiobooks from current position
I Have Some Android Application On Google Play Store Of Version GingerBread.Many Users Install
Im done creating an android application and already published it on google play. What
i have develop one application in which i want to play gif animation. for
I have an android application and want to save the state of instance 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.