Back to project page SevenWonders.
The source code is released under:
Apache License
If you think the Android project SevenWonders listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package skylight1.sevenwonders; /* www . j a va 2 s . com*/ import java.lang.Thread.UncaughtExceptionHandler; import skylight1.sevenwonders.services.SoundTracks; import android.util.Log; /** * @author Rob * * For when we crash for unknown reasons. First use: turn off the sound */ public class SoundTracksStoppingExceptionHandler implements UncaughtExceptionHandler { private static final String TAG = SoundTracksStoppingExceptionHandler.class.getName(); private UncaughtExceptionHandler defaultVersion; SoundTracksStoppingExceptionHandler() { defaultVersion = Thread.getDefaultUncaughtExceptionHandler(); Thread.setDefaultUncaughtExceptionHandler(this); } @Override public void uncaughtException(final Thread aThread, final Throwable aThrowable) { if(aThrowable.getMessage()!=null && aThrowable.getMessage().indexOf("adwhirl")>0 ) { return; } try { if (SoundTracks.getInstance() != null) { SoundTracks.getInstance().stop(); } } catch (final Throwable anotherT) { Log.e(TAG, "'You can't stop the music' - Village People", anotherT); } defaultVersion.uncaughtException(aThread, aThrowable); } }