Android: fix 'JVM object referenced by 'context' is of type 'Context' and it d… (#14016)

fix 'JVM object referenced by 'context' is of type 'Context' and it does not have access to method 'registerReceiver(BroadcastReceiver, IntentFilter)' declared in class 'ContextWrapper'.'
This commit is contained in:
Brenton Bostick
2025-09-22 11:15:48 -04:00
committed by GitHub
parent d86e0db683
commit 8abbb98222
3 changed files with 6 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
package org.libsdl.app;
import android.app.Activity;
import android.content.Context;
import java.lang.Class;
import java.lang.reflect.Method;
/**
@@ -28,12 +28,12 @@ public class SDL {
}
// This function stores the current activity (SDL or not)
static public void setContext(Context context) {
static public void setContext(Activity context) {
SDLAudioManager.setContext(context);
mContext = context;
}
static public Context getContext() {
static public Activity getContext() {
return mContext;
}
@@ -86,5 +86,5 @@ public class SDL {
}
}
protected static Context mContext;
protected static Activity mContext;
}

View File

@@ -1262,7 +1262,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/**
* This method is called by SDL using JNI.
*/
public static Context getContext() {
public static Activity getContext() {
return SDL.getContext();
}