|
29 | 29 |
|
30 | 30 | import android.app.Activity; |
31 | 31 | import android.content.Context; |
| 32 | +import android.content.Intent; |
32 | 33 | import android.content.pm.ActivityInfo; |
33 | 34 | import android.util.Log; |
34 | 35 | import android.view.SurfaceHolder; |
35 | 36 | import android.view.SurfaceView; |
36 | 37 | import android.opengl.GLSurfaceView; |
37 | 38 | import android.view.MotionEvent; |
38 | 39 | import android.view.KeyEvent; |
| 40 | +import android.net.Uri; |
39 | 41 | import android.os.PowerManager; |
40 | 42 |
|
41 | 43 | import java.io.IOException; |
@@ -262,7 +264,7 @@ private void printConfig(EGL10 egl, EGLDisplay display, |
262 | 264 | } |
263 | 265 |
|
264 | 266 | // The activity we're a part of. |
265 | | - private Activity mActivity; |
| 267 | + private static Activity mActivity; |
266 | 268 |
|
267 | 269 | // Have we started yet? |
268 | 270 | public boolean mStarted = false; |
@@ -937,6 +939,14 @@ static void activateInput() { |
937 | 939 | mInputActivated = true; |
938 | 940 | } |
939 | 941 |
|
| 942 | + static void openUrl(String url) { |
| 943 | + Log.i("python", "Opening URL: " + url); |
| 944 | + |
| 945 | + Intent i = new Intent(Intent.ACTION_VIEW); |
| 946 | + i.setData(Uri.parse(url)); |
| 947 | + mActivity.startActivity(i); |
| 948 | + } |
| 949 | + |
940 | 950 | // Taken from the "GLES20TriangleRenderer" in Android SDK |
941 | 951 | private int loadShader(int shaderType, String source) { |
942 | 952 | int shader = GLES20.glCreateShader(shaderType); |
|
0 commit comments