Playing Audio Upon Starting an Android App

时间:2016-07-11 21:28:34

标签: android splash-screen

I am creating a splash screen for an Android application. It should not be a delay, but rather serve the purpose of a loading screen. I already have the visual element of it working, but cannot think of how to implement the audio. Just to be clear I do not want to put the code in onCreate(); it needs to play as soon as the app is opened. Any help is appreciated.

1 个答案:

答案 0 :(得分:0)

OnCreate of the first Activity to be launched is the earliest you can start the audio. Its the right place to put it if you want it to play immediately. Unless you want it to continue to play after the loading activity is finished- in that case the onCreate should start a service which plays the music.