23 lines
627 B
Java
23 lines
627 B
Java
![]() |
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();
|
||
|
System.out.println("---- RestartService onCreate");
|
||
|
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");
|
||
|
}
|
||
|
}
|