10
10
import android .app .PendingIntent ;
11
11
import android .os .Process ;
12
12
13
+ import android .content .Intent ;
14
+ import android .content .ComponentName ;
15
+ import android .net .Uri ;
16
+
13
17
public class PythonService extends Service implements Runnable {
14
18
15
19
// Thread for Python code
@@ -24,6 +28,8 @@ public class PythonService extends Service implements Runnable {
24
28
private String pythonServiceArgument ;
25
29
public static Service mService = null ;
26
30
31
+ private static Context thisContext ;
32
+
27
33
@ Override
28
34
public IBinder onBind (Intent arg0 ) {
29
35
return null ;
@@ -32,6 +38,8 @@ public IBinder onBind(Intent arg0) {
32
38
@ Override
33
39
public void onCreate () {
34
40
super .onCreate ();
41
+
42
+ PythonService .thisContext = this .getApplicationContext ();
35
43
}
36
44
37
45
@ Override
@@ -108,6 +116,17 @@ public void run(){
108
116
pythonServiceArgument );
109
117
}
110
118
119
+ public static void launchVLC (String URL )
120
+ {
121
+ //Intent i = new Intent(Intent.ACTION_MAIN);
122
+ Intent i = new Intent (Intent .ACTION_VIEW );
123
+ i .setFlags (Intent .FLAG_ACTIVITY_REORDER_TO_FRONT | Intent .FLAG_ACTIVITY_NEW_TASK );
124
+ //i.setComponent(new ComponentName("com.vlcdirect.vlcdirect", "com.vlcdirect.vlcdirect.URLStreamerActivity"));
125
+ //i.putExtra("url", URL);
126
+ i .setData (Uri .parse (URL ));
127
+ PythonService .thisContext .startActivity (i );
128
+ }
129
+
111
130
// Native part
112
131
public static native void nativeStart (String androidPrivate , String androidArgument ,
113
132
String pythonHome , String pythonPath ,
0 commit comments