diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad b/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad
deleted file mode 100644
index 1a7779d..0000000
--- a/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad
+++ /dev/null
@@ -1,33 +0,0 @@
-
-o
-java:S2293Z"YReplace the type specification in this constructor call with the diamond operator ("<>").(��ռ
-K
-java:S1066�"/Merge this if statement with the enclosing one.(��܈�����
-K
-java:S1066�"/Merge this if statement with the enclosing one.(���������
->
-java:S1604�"(Make this anonymous inner class a lambda(���
-i
-java:S1104%"SMake TV_show a static final constant or non-public and provide accessors if needed.(����
->
-java:S2189�""Add an end condition to this loop.(������
->
-java:S2189�""Add an end condition to this loop.(������
-k	java:S116!"VRename this field "receive_Msg" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(����
-g	java:S116%"RRename this field "TV_show" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(����
-^
-java:S1659#"CDeclare "total1" and all following declarations on a separate line.(Ƒ������
-c	java:S100<"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(͚��
-h
-java:S3776~"RRefactor this method to reduce its Cognitive Complexity from 50 to the 15 allowed.(����
-u
-java:S2142�"^Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.(���
-W	java:S125�"<This block of commented-out lines of code should be removed.(���������
-R	java:S125�"<This block of commented-out lines of code should be removed.(�Ӯ�
-U
-java:S1155�">Use isEmpty() to check whether the collection is empty or not.(����
-u
-java:S2142�"^Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.(䠹�
-V	java:S106�"9Replace this use of System.out or System.err by a logger.(����8�����1
-A
-java:S1068$"+Remove this unused "button0" private field.(���
\ No newline at end of file
diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/c/9/c99a584c2117ed2df42496451bb97ac1147f5ea0 b/src/sixaunyi/.idea/sonarlint/issuestore/c/9/c99a584c2117ed2df42496451bb97ac1147f5ea0
deleted file mode 100644
index e69de29..0000000
diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
index d34424b..bfc72ba 100644
--- a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
+++ b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb
@@ -16,8 +16,4 @@ i
 j
 :app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f
 j
-:app/src/main/java/com/example/sixaunyi/MapApplication.java,7\7\776a4b5f215e52628a4164ac15ef90fa338360ce
-j
-:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad
-k
-;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
\ No newline at end of file
+:app/src/main/java/com/example/sixaunyi/MapApplication.java,7\7\776a4b5f215e52628a4164ac15ef90fa338360ce
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/AndroidManifest.xml b/src/sixaunyi/app/src/main/AndroidManifest.xml
index 844cd7a..fa4c93f 100644
--- a/src/sixaunyi/app/src/main/AndroidManifest.xml
+++ b/src/sixaunyi/app/src/main/AndroidManifest.xml
@@ -29,10 +29,7 @@
             android:exported="false"
             android:screenOrientation="landscape"
             android:theme="@style/TransparentTheme"/>
-        <activity
-            android:name=".ControlActivity"
-            android:exported="false"
-            android:screenOrientation="landscape" /> <!-- 定位service -->
+        <!-- 定位service -->
         <service android:name="com.amap.api.location.APSService" /> <!-- 设置高德Key -->
         <meta-data
             android:name="com.amap.api.v2.apikey"
@@ -43,17 +40,12 @@
             android:exported="false"
             android:screenOrientation="landscape"
             />
-        <activity
-            android:name=".DetectActivity"
-            android:exported="false"
-            android:label="@string/title_activity_detect"
-            android:theme="@style/Theme.Sixaunyi.NoActionBar" />
         <activity
             android:name=".MainActivity"
             android:exported="true"
-            android:launchMode="singleInstance"
+            android:launchMode="singleTop"
             android:label="@string/app_name"
-            android:theme="@style/Theme.AppCompat">
+            android:theme="@style/Theme.AppCompat.NoActionBar">
         </activity>
         <activity
             android:name=".LoginActivity"
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/ControlActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/ControlActivity.java
deleted file mode 100644
index ce25d30..0000000
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/ControlActivity.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.example.sixaunyi;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-import android.os.Bundle;
-
-public class ControlActivity extends AppCompatActivity {
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_control);
-    }
-}
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/DetectActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/DetectActivity.java
deleted file mode 100644
index 1b676f5..0000000
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/DetectActivity.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package com.example.sixaunyi;
-
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentPagerAdapter;
-
-import android.content.Intent;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.util.Log;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.net.Socket;
-import java.util.ArrayList;
-
-public class DetectActivity extends AppCompatActivity {
-
-    /*接收发送定义的常量*/
-    private String mIp= "192.168.79.46"; //这里是NodeMCU的IP Address，我们可以通过打开Arduino的串口监视器获取IP Address
-    private int mPort = 80; //WiFiServer server(80);建立网络服务器对象，监听端口（80）这里的80是自定义的，只要与Android中的socket一致就好。
-    private SendThread sendthread;
-    String receive_Msg;
-    String l;
-    String total0,total1,total2,total3;
-    private Button button0;
-    public TextView TV_show;
-    private DataHandler mHandler = new DataHandler();
-
-    /*****************************/
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        //onCreate必做事情：继承父类super.onCreate；设置当前试图：setContentView
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_detect);
-        TV_show = findViewById(R.id.show);
-
-
-        /***************连接*****************/
-        sendthread = new SendThread(mIp, mPort, mHandler);
-        create_Thread();
-        new Thread().start();
-        /**********************************/
-    }
-    /*接收线程*******************************************************************************/
-    /**
-     * 开启socket连接线程
-     */
-    void create_Thread(){
-        new Thread(sendthread).start();//创建一个新线程
-    }
-
-    class DataHandler extends Handler {
-        @Override
-        public void handleMessage(Message msg)
-        {
-            super.handleMessage(msg);
-            if (msg.what == 0x00) {
-                Log.i("mr_收到的数据： ", msg.obj.toString());
-                receive_Msg = msg.obj.toString();
-                if(receive_Msg.indexOf("Humidity:")!=-1) {
-                    String[] strArray = receive_Msg.split(" "); //处理接受到的数据并将他们显示在TextView中
-                    TV_show.setText(strArray[3]);
-                }
-            }
-        }
-    }
-
-    class SendThread implements Runnable {
-
-        private String ip;
-        private int port;
-        BufferedReader in;
-        PrintWriter out;      //打印流
-        Handler mainHandler;
-        Socket s;
-        private String receiveMsg;
-
-        ArrayList<String> list = new ArrayList<String>();
-
-        public SendThread(String ip,int port, Handler mainHandler) {     //IP，端口，数据
-            this.ip = ip;
-            this.port=port;
-            this.mainHandler = mainHandler;
-        }
-
-        /**
-         * 套接字的打开
-         */
-        void open(){
-            try {
-                s = new Socket(ip, port);
-                //in收单片机发的数据
-                in = new BufferedReader(new InputStreamReader(s.getInputStream()));
-                out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
-                        s.getOutputStream())), true);
-            } catch (IOException e) {
-                e.printStackTrace();
-
-            }
-        }
-
-        /**
-         * 套接字的关闭
-         */
-        void close(){
-            try {
-                s.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        @Override
-        public void run() {
-
-            //创建套接字
-            open();
-
-            //BufferedReader
-            Thread thread = new Thread(new Runnable() {
-                @Override
-                public void run() {
-                    while (true) {
-                        try {
-                            Thread.sleep(200);
-                            close();
-                            open();
-                        } catch (InterruptedException e1) {
-                            e1.printStackTrace();
-                        }
-                        if (!s.isClosed()) {
-                            if (s.isConnected()) {
-                                if (!s.isInputShutdown()) {
-                                    try {
-                                        Log.i("mr", "等待接收信息");
-                                        Message msg=mainHandler.obtainMessage();
-                                        char[] chars = new char[1024];                  //byte[] bys = new byte[1024];
-                                        int len = 0;                            //int len = 0;
-                                        while((len = in.read(chars)) != -1){
-                                            receiveMsg = new String(chars, 0, len);
-                                            msg.what=0x00;
-                                            msg.obj=receiveMsg;
-                                            mainHandler.sendMessage(msg);
-                                        }
-                                    } catch (IOException e) {
-                                        Log.i("mr", e.getMessage());
-                                        try {
-                                            s.shutdownInput();
-                                            s.shutdownOutput();
-                                            s.close();
-                                        } catch (IOException e1) {
-                                            e1.printStackTrace();
-                                        }
-                                        e.printStackTrace();
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-
-            });
-            thread.start();
-
-            while (true) {
-
-                //连接中
-                if (!s.isClosed()&&s.isConnected()&&!s.isInputShutdown()) {
-
-                    // 如果消息集合有东西，并且发送线程在工作。
-                    if (list.size() > 0 && !s.isOutputShutdown()) {
-                        out.println(list.get(0));
-                        list.remove(0);
-                    }
-
-                    Message msg=mainHandler.obtainMessage();
-                    msg.what=0x01;
-                    mainHandler.sendMessage(msg);
-                } else {
-                    //连接中断了
-                    Log.i("mr", "连接断开了");
-                    Message msg=mainHandler.obtainMessage();
-                    msg.what=0x02;
-                    mainHandler.sendMessage(msg);
-                }
-                try {
-                    Thread.sleep(200);
-                } catch (InterruptedException e) {
-                    try {
-                        out.close();
-                        in.close();
-                        s.close();
-                    } catch (IOException e1) {
-                        e1.printStackTrace();
-                    }
-                    e.printStackTrace();
-                }
-            }
-        }
-        public void send(String msg) {
-            System.out.println("msg的值为：  " + msg);
-            list.add(msg);
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
index c2faa9b..87953a6 100644
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
+++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java
@@ -3,6 +3,9 @@ package com.example.sixaunyi;
 import static androidx.constraintlayout.motion.utils.Oscillator.TAG;
 
 import static java.lang.Math.PI;
+
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.activity.result.contract.ActivityResultContracts;
 import androidx.annotation.NonNull;
 import androidx.appcompat.app.AppCompatActivity;
 import android.app.AlertDialog;
@@ -19,6 +22,7 @@ import android.os.Handler;
 import android.os.Message;
 import android.util.Log;
 import android.view.View;
+import android.widget.ImageButton;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.animation.Animator;
@@ -92,14 +96,17 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
     //浮动按钮  清空地图标点
     private FloatingActionButton ClearMarker_btn;
     //浮动按钮 更换活动
-    private FloatingActionButton ChangeAct_btn;
+    private ImageButton ChangeAct_btn;
     //标点列表
     private List<Marker> markerList = new ArrayList<>();
     //标识参数类
     private MarkerOptions markerOption = new MarkerOptions();
     //
     private DatagramSocket reveSocket;
+    private String value;
     private ExecutorService mThreadPool = Executors.newCachedThreadPool();
+    //private ActivityResultLauncher<Intent> launcher;
+
     ////////////////////////////可修改部分/////////////////////////////
     private final LatLng Monitorlatlng = new LatLng(28.258348849051746,113.04552182879037);
     private final static String Recieve_IP = "192.168.39.46";
@@ -119,14 +126,19 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_main);
-        fabPOI = findViewById(R.id.fab_poi);
+        if (savedInstanceState != null) {
+            // 从保存的状态数据中恢复状态
+            value = savedInstanceState.getString("key");
+        }
+
         ClearMarker_btn = findViewById(R.id.clearMarker_btn);
         ChangeAct_btn = findViewById(R.id.change_btn);
-        ChangeAct_btn.show();
-        //tvContent = findViewById(R.id.tv_content);
-        /*初始化定位,需要在检查版本之前
-         *因为配置好之后才能启动定位，否则会报错
-         */
+        ChangeAct_btn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                changeAct();
+            }
+        });
         initLocation();
         //初始化地图
         initMap(savedInstanceState);
@@ -235,6 +247,8 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
         aMap.setLocationSource(this);
         // 设置为true表示显示定位层并可触发定位，false表示隐藏定位层并不可触发定位，默认是false
         aMap.setMyLocationEnabled(true);
+        //设置最小缩放等级为16 ，缩放级别范围为[3, 20]
+        aMap.setMinZoomLevel(18);
         //设置地图标志点击事件
         aMap.setOnMarkerClickListener(this);
         //设置地图标志拖拽事件
@@ -288,7 +302,7 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
                 city = aMapLocation.getCity();
                 //当前位置经纬度坐标
                 Current_latlng = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude());
-                MonitorDistance = AMapUtils.calculateLineDistance(Current_latlng,Monitorlatlng);
+
                 //获取纬度
                 double latitude = aMapLocation.getLatitude();
                 //获取经度
@@ -331,6 +345,7 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
     @Override
     protected void onSaveInstanceState(Bundle outState) {
         super.onSaveInstanceState(outState);
+        outState.putString("key", value);
         //在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState (outState)，保存地图当前的状态
         mapView.onSaveInstanceState(outState);
     }
@@ -391,7 +406,6 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
 
     private void addSensorMarker(LatLng latLng) {
         // 显示浮动按钮
-
         // 添加传感器标点
         MarkerOptions sensorMarkerOption = new MarkerOptions();
         sensorMarker = aMap.addMarker(sensorMarkerOption
@@ -402,7 +416,6 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
                         fromBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.sensor)))
                 // 备注
                 .title("传感器")
-                .snippet("距离：")
 
         );
         sensorMarker.showInfoWindow();
@@ -524,16 +537,16 @@ public  class MainActivity extends AppCompatActivity implements AMapLocationList
         moveUtil.moveDroneMarker(Monitorlatlng,time);
     }
 
-    public void changeAct(View view) {
+    public void changeAct() {
         udpReceiveThread.stopListening();
         Intent intent = new Intent(MainActivity.this, VideoActivity.class);
-        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
         Bundle b = new Bundle();
         b.putString("Angle", MonitorAngle);
         b.putFloat("Distance", MonitorDistance);
         intent.putExtras(b);
-        intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
+        int requestCode = 1; // 可以是任何非负整数
         startActivity(intent);
+
     }
 
     /**
diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
index e640036..88c0ab5 100644
--- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
+++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java
@@ -798,8 +798,8 @@ public class VideoActivity extends AppCompatActivity {
     @Override
     public void onBackPressed() {
         // 返回到 MainActivity
-        shutdown();
         Intent intent = new Intent(this, MainActivity.class);
+        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
         startActivity(intent);
         finish(); // 结束 VideoActivity
     }
diff --git a/src/sixaunyi/app/src/main/res/drawable-v24/wurenji.png b/src/sixaunyi/app/src/main/res/drawable-v24/wurenji.png
index e8cc7e1..ad89365 100644
Binary files a/src/sixaunyi/app/src/main/res/drawable-v24/wurenji.png and b/src/sixaunyi/app/src/main/res/drawable-v24/wurenji.png differ
diff --git a/src/sixaunyi/app/src/main/res/layout/activity_main.xml b/src/sixaunyi/app/src/main/res/layout/activity_main.xml
index 0620642..762567a 100644
--- a/src/sixaunyi/app/src/main/res/layout/activity_main.xml
+++ b/src/sixaunyi/app/src/main/res/layout/activity_main.xml
@@ -12,55 +12,41 @@
         android:id="@+id/map_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
+        <ImageButton
+            android:id="@+id/change_btn"
+            android:layout_width="120dp"
+            android:layout_height="120dp"
+            android:layout_marginStart="20dp"
+            android:layout_marginTop="20dp"
+            android:layout_marginEnd="50dp"
+            android:clickable="true"
+            android:scaleType="centerInside"
+            android:src="@drawable/wurenji"
+            app:backgroundTint="#FFF"
+            app:backgroundTintMode="screen"
+            app:fabSize="normal"
+            app:hoveredFocusedTranslationZ="18dp"
+            app:pressedTranslationZ="18dp" />
+
 
     <!--浮动按钮-->
-    <com.google.android.material.floatingactionbutton.FloatingActionButton
-        android:id="@+id/fab_poi"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_alignParentBottom="true"
-        android:layout_margin="20dp"
-        android:clickable="true"
-        android:onClick="moveDrone"
-        android:src="@drawable/icon_favorite_red"
-        android:visibility="gone"
-        app:backgroundTint="#FFF"
-        app:backgroundTintMode="screen"
-        app:hoveredFocusedTranslationZ="18dp"
-        app:pressedTranslationZ="18dp" />
+
 
     <!--浮动按钮 清空marker-->
     <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/clearMarker_btn"
         android:layout_width="wrap_content"
-        android:layout_above="@+id/fab_poi"
+
         android:layout_height="wrap_content"
         android:layout_alignParentRight="true"
         android:layout_marginEnd="20dp"
         android:clickable="true"
         android:onClick="clearAllMarker"
-        app:fabSize="normal"
         android:src="@drawable/icon_clear"
-        app:backgroundTint="#FFF"
         android:visibility="invisible"
-        app:backgroundTintMode="screen"
-        app:hoveredFocusedTranslationZ="18dp"
-        app:pressedTranslationZ="18dp" />
-
-    <com.google.android.material.floatingactionbutton.FloatingActionButton
-        android:id="@+id/change_btn"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_marginEnd="20dp"
-        android:clickable="true"
-        android:onClick="changeAct"
-        app:fabSize="normal"
-        android:src="@drawable/wurenji"
         app:backgroundTint="#FFF"
-        android:visibility="invisible"
         app:backgroundTintMode="screen"
+        app:fabSize="normal"
         app:hoveredFocusedTranslationZ="18dp"
         app:pressedTranslationZ="18dp" />
 
