How do I go about getting my app to play an mp3 (in my res) on startup? Or how how about if I wanted this to happen when a button is clicked?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
From the Audio and Video section of the Dev Guide:
So put the above code example in the onCreate() or onStart() of your launcher activity to have it play on startup, and place it in a button’s onClick() method to respond to a button press.