我在 Android 上使用 Andengine。我有两个类(主要和函数),如下所示。
主要的:
private Context myContext;
.
.
if (functions.Sonido(myContext)) {
   mSound.play();
}
功能:
    public boolean Sonido(Context C) {
    prefs =  C.getSharedPreferences(Filename, Context.MODE_PRIVATE);
    valor = prefs.getString("Sound", null);
    if (valor == "YES") {
        return true;
    }else{
        return false;
    }
    }
编辑器没有给出任何错误,但我得到了运行时错误。请协助我解决它们。