设备插入卸载监听优化

chengzhenyu 6 年之前
父节点
当前提交
8305b33f2f
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      app/src/main/java/com/ptplib/usbcamera/test/MyTestActivity.java

+ 2 - 4
app/src/main/java/com/ptplib/usbcamera/test/MyTestActivity.java

@@ -8,7 +8,6 @@ import android.content.IntentFilter;
8 8
 import android.hardware.usb.UsbDevice;
9 9
 import android.hardware.usb.UsbManager;
10 10
 import android.os.Bundle;
11
-import android.util.Log;
12 11
 import android.view.View;
13 12
 import android.widget.ImageView;
14 13
 import android.widget.ListView;
@@ -31,8 +30,6 @@ public class MyTestActivity extends Activity {
31 30
     private BaselineInitiator bi;
32 31
     private NameFactory factory = new NameFactory();
33 32
 
34
-    private static final String TAG = "USBTest";
35
-
36 33
     @Override
37 34
     protected void onCreate(Bundle savedInstanceState) {
38 35
         super.onCreate(savedInstanceState);
@@ -155,7 +152,8 @@ public class MyTestActivity extends Activity {
155 152
 
156 153
     public void detachDevice () {
157 154
         if (bi != null) {
158
-            if (bi.getDevice() != null) Log.d(TAG, "detachDevice: " +bi.getDevice().getDeviceName());
155
+            if (bi.getDevice() != null)
156
+                adapter.addInfo("完成设备卸载 "+bi.getDevice().getDeviceName());
159 157
             try {
160 158
                 bi.close();
161 159
             } catch (PTPException e) {