2023-11-10 21:45:00 +08:00
|
|
|
package com.xixun.xixunplayer;
|
|
|
|
|
|
|
|
import android.app.Service;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.IBinder;
|
|
|
|
|
|
|
|
public class RestartService extends Service {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onCreate() {
|
|
|
|
super.onCreate();
|
2024-01-24 20:17:59 +08:00
|
|
|
Util.println("---- RestartService onCreate");
|
2023-11-10 21:45:00 +08:00
|
|
|
if(MainActivity.ins!=null) return;
|
|
|
|
var intent = new Intent(this, MainActivity.class);
|
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
|
startActivity(intent);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IBinder onBind(Intent intent) {
|
|
|
|
throw new UnsupportedOperationException("Not yet implemented");
|
|
|
|
}
|
|
|
|
}
|