最近我正在尝试使用 SoundPool 在我的应用程序中播放一些简单的音效
但不幸的是它在 AVD 中不起作用并且应用程序崩溃
“上下文”到底是什么意思?
完全不懂
提前致谢
最佳答案
任何上下文都允许访问特定于应用程序的资源和类,以及对应用程序级操作(例如启动 Activity 、广播和接收 Intent 等)的向上调用。
通常您可以使用 this.YourClassName
作为上下文。
例如:soundID = soundPool.load(this.MainActivity, R.raw.sound1, 1);
关于android - "context"到底是什么意思?对于 soundPool.load int load(Context context, int resId, int priority),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18909912/