mac
2023-11-21 9f9e16bc9b4caecf741339a0699d784558fbc738
app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpService.java
@@ -2,6 +2,7 @@
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import androidx.annotation.Nullable;
@@ -9,11 +10,7 @@
public class MyNanoHttpService extends Service {
    private MyNanoHttpServer myNanoHttpServer = MyNanoHttpServer.getInstance(null);
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
    private final IBinder mBinder = new LocalBinder();
    @Override
    public void onCreate() {
@@ -38,4 +35,17 @@
        super.onDestroy();
        myNanoHttpServer.stop();
    }
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return mBinder;
    }
    public class LocalBinder extends Binder {
        public MyNanoHttpService getService() {
            // Return this instance of LocalService so clients can call public methods
            return MyNanoHttpService.this;
        }
    }
}