mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-09 11:26:29 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user