Target OS: Android
Titanium SDK: 3.2.2GA
Hi, I wrote a little game. There are 12 buttons and each button, when touched, reproduces a little mp3 file. I use a mediaSound object:
var effetto = Ti.Media.createSound({});and the function called when a button is touched is:
function effettoSonoro(obj){ effetto.reset(); effetto.release(); if(obj=='endGame.mp3'){ effetto.url = 'audio/' + obj; effetto.play(); effetto = null; } else{ effetto.url = obj.suono; effetto.play(); }; };I'm going crazy because I'm not able to solve my problem: sometimes in a very random way my app crashes when a button is touched and this is the error log:
[WARN] : dalvikvm: threadid=17: thread exiting with uncaught exception (group=0x40015560) [ERROR] : TiApplication: (Timer-31) [31313,469145] Sending event: exception on thread: Timer-31 msg:java.lang.IllegalStateException; Titanium 3.2.2,2014/03/05 12:22,96e9a07 [ERROR] : TiApplication: java.lang.IllegalStateException [ERROR] : TiApplication: at android.media.MediaPlayer.isPlaying(Native Method) [ERROR] : TiApplication: at ti.modules.titanium.media.TiSound$2.run(TiSound.java:516) [ERROR] : TiApplication: at java.util.Timer$TimerImpl.run(Timer.java:284) [ERROR] : AndroidRuntime: FATAL EXCEPTION: Timer-31 [ERROR] : AndroidRuntime: java.lang.IllegalStateException [ERROR] : AndroidRuntime: at android.media.MediaPlayer.isPlaying(Native Method) [ERROR] : AndroidRuntime: at ti.modules.titanium.media.TiSound$2.run(TiSound.java:516) [ERROR] : AndroidRuntime: at java.util.Timer$TimerImpl.run(Timer.java:284)Is there anyone able to help me fixing this issue? Thanks for the attention.