2
中OpenCore实例的最大数量,它显示“超出OpenCore实例的最大数量”错误。如何解决此错误。 谢谢当我运行我的应用程序时,超出了android
中OpenCore实例的最大数量,它显示“超出OpenCore实例的最大数量”错误。如何解决此错误。 谢谢当我运行我的应用程序时,超出了android
如果您实例化MediaPlayer的多个实例,则会发生上述情况。
你应该阅读有关the lifecycle of the media player and its different states
媒体播放器被定义为一类范围变量和在OnCreate实例化()方法
private void startPlayingAudio()
{
try {
Uri path1 = Uri.parse("android.resource://com.yourpackagehere./" + R.raw.beep);
mp.reset(); // reset to idle state
mp.setDataSource(this, path1); // from idle to initialised state
mp.prepare();
mp.start();
} catch (Exception ioe) {
Log.e(LOG_TAG, "Error playing the beep sound");
}
}