From 7ae3378cab3a872f0f1bc8dfbc4dd9fad303d875 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期三, 08 十二月 2021 09:34:44 +0800
Subject: [PATCH] 修改下细节

---
 HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
index ea90450..5f9fcfd 100644
--- a/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
+++ b/HDLSDK/app/src/main/java/com/hdl/hdlsdk/MainActivity.java
@@ -9,6 +9,7 @@
 import androidx.recyclerview.widget.RecyclerView;
 
 import android.Manifest;
+import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.util.Log;
@@ -19,6 +20,7 @@
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
 import com.google.gson.reflect.TypeToken;
+import com.hdl.hdlsdk.device.DevicesListActivity;
 import com.hdl.sdk.common.event.EventListener;
 import com.hdl.sdk.common.exception.HDLLinkException;
 import com.hdl.sdk.common.utils.IdUtils;
@@ -97,13 +99,14 @@
         beans.add(new DemoBean("璇诲彇鐘舵��"));
         beans.add(new DemoBean("鑾峰彇鍦烘櫙鍒楄〃"));
         beans.add(new DemoBean("鍦烘櫙鎺у埗"));
+        beans.add(new DemoBean("璁惧鍔熻兘鍒楄〃"));
         demoAdapter = new DemoAdapter(beans);
         rv.setAdapter(demoAdapter);
 
 
 //        final SocketOptions options = new SocketOptions();
 //
-        MessagePipeLine pipeLine = new MessagePipeLine();
+//        MessagePipeLine pipeLine = new MessagePipeLine();
 //        options.setHandleMessage(pipeLine);
 //        options.setEnabledHeartbeat(false);
 
@@ -143,6 +146,10 @@
                         //鑾峰彇鍦烘櫙鍒楄〃
                         controlScene();
                         break;
+                    case 8:
+                        //鍔熻兘鍒楄〃
+                        startDevicesListActivity();
+                        break;
                 }
             }
         });
@@ -169,13 +176,6 @@
             @Override
             public void onMessage(Object msg) {
                 LinkResponse response = (LinkResponse)msg;
-                if(response != null){
-                    Log.i(TAG, "AllTopicsListener"
-                            + "\nTopic: " + response.getTopic()
-                            +"\n Data: " + response.getData());
-                    handleLinkResponse(response);
-                }
-
             }
         };
         HDLLink.getInstance().registerAllTopicsListener(allTopicsListener);
@@ -313,6 +313,7 @@
             @Override
             public void onError(HDLLinkException e) {
                 tv.setText("缃戝叧涓嶅湪绾�");
+                responseTv.setText(e.getMsg());
             }
             @Override
             public void onSuccess(GatewaySearchBean gatewaySearchBean) {
@@ -464,4 +465,8 @@
     }
 
 
+    void startDevicesListActivity(){
+        Intent intent = new Intent(this, DevicesListActivity.class);
+        startActivity(intent);
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0