mirror of https://github.com/FongMi/TV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
905 B
43 lines
905 B
package com.gsoft.mitv;
|
|
|
|
import android.app.Service;
|
|
import android.content.Intent;
|
|
import android.os.IBinder;
|
|
|
|
import com.anymediacloud.iptv.standard.ForceTV;
|
|
import com.forcetech.Util;
|
|
|
|
public class MainActivity extends Service {
|
|
|
|
private ForceTV forceTV;
|
|
private IBinder binder;
|
|
|
|
static {
|
|
System.loadLibrary("mitv");
|
|
}
|
|
|
|
@Override
|
|
public void onCreate() {
|
|
super.onCreate();
|
|
try {
|
|
binder = new LocalBinder();
|
|
loadLibrary(1);
|
|
} catch (Throwable ignored) {
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public IBinder onBind(Intent intent) {
|
|
forceTV = new ForceTV();
|
|
forceTV.start(Util.MTV);
|
|
return binder;
|
|
}
|
|
|
|
@Override
|
|
public boolean onUnbind(Intent intent) {
|
|
if (forceTV != null) forceTV.stop();
|
|
return super.onUnbind(intent);
|
|
}
|
|
|
|
private native void loadLibrary(int type);
|
|
}
|
|
|