初始化

This commit is contained in:
2022-08-24 09:32:54 +08:00
parent 0d349c559c
commit 8e4d517c40
800 changed files with 74927 additions and 20 deletions
@@ -0,0 +1,47 @@
package com.arpa.hndahesudintocctmsdriver.service;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
/**
* @author hlh
* @version 1.0.0
* @date 2021/8/31 19:54
* @description:
*/
public class RestartService extends Service {
private Context con;
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
//Service被启动的时候回调onStartCommand方法
public int onStartCommand(Intent intent, int flags, int startId){
Log.e("---static---","启动");
return START_STICKY;
}
@Override
public void onCreate() {
super.onCreate();
con=getApplication();
Intent in=new Intent(con, MainActivity.class);
startActivity(in);
}
@Override
public void onDestroy() {
super.onDestroy();
}
}