JLChen
2021-12-07 d6a2ca78cc573243a44ff805ac01935fd36bb6d8
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,6 +99,7 @@
        beans.add(new DemoBean("读取状态"));
        beans.add(new DemoBean("获取场景列表"));
        beans.add(new DemoBean("场景控制"));
        beans.add(new DemoBean("设备功能列表"));
        demoAdapter = new DemoAdapter(beans);
        rv.setAdapter(demoAdapter);
@@ -142,6 +145,10 @@
                    case 7:
                        //获取场景列表
                        controlScene();
                        break;
                    case 8:
                        //功能列表
                        startDevicesListActivity();
                        break;
                }
            }
@@ -313,6 +320,7 @@
            @Override
            public void onError(HDLLinkException e) {
                tv.setText("网关不在线");
                responseTv.setText(e.getMsg());
            }
            @Override
            public void onSuccess(GatewaySearchBean gatewaySearchBean) {
@@ -464,4 +472,8 @@
    }
    void startDevicesListActivity(){
        Intent intent = new Intent(this, DevicesListActivity.class);
        startActivity(intent);
    }
}