diff --git a/app/src/main/java/com/common/commonlibtest/DemoActivity.java b/app/src/main/java/com/common/commonlibtest/DemoActivity.java index 27d5150..1afb0c6 100644 --- a/app/src/main/java/com/common/commonlibtest/DemoActivity.java +++ b/app/src/main/java/com/common/commonlibtest/DemoActivity.java @@ -14,6 +14,7 @@ import com.common.commonlib.net.callback.RequestNoResultCallBack; import com.common.commonlib.net.callback.RequestResultCallBack; import com.common.commonlib.net.interceptor.RequestHeadInterceptor; import com.common.commonlib.net.interceptor.ResponseHeadInterceptor; +import com.common.commonlib.serialport.SerialPortUtil; import com.common.commonlib.utils.BaseUtils; import com.common.commonlib.utils.FTPUtils; import com.common.commonlib.utils.MMKVUtils; @@ -133,7 +134,12 @@ public class DemoActivity extends AppCompatActivity { binding.mmkv.setOnClickListener(l -> { MMKVUtils.INSTANCE.put("key", 100, "aa"); int value = MMKVUtils.INSTANCE.getInt("key", "bb"); - Toast.makeText(DemoActivity.this, ""+value, Toast.LENGTH_SHORT).show(); + Toast.makeText(DemoActivity.this, "" + value, Toast.LENGTH_SHORT).show(); + }); + + binding.port.setOnClickListener(l -> { + SerialPortUtil serialPortUtil = new SerialPortUtil(); + serialPortUtil.openSerialPort(); }); } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5914f02..e813bf9 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -106,4 +106,16 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.9" /> +