I made an application and inside onCreate method i load 16 different soundpools. Everything works fine, but it starts very slow, I mean after I click an app icon nothing’s happening for about 3 seconds then my activity starts. How to make something like loading notification which starts first after a click on icon and then hides when all soundpools are ready. Thanks for help
I made an application and inside onCreate method i load 16 different soundpools. Everything
Share
You can initialize the SoundPool on a background thread, and if you wrap this in an AsyncTask, you can display a ProgressDialog in AsyncTask.onPreExecute and dismiss the dialog in AsyncTask.onPostExecute. That way you’re not blocking in onCreate and your Activity doesn’t have to wait until the sounds are loaded to display the UI.