コード例 #1
0
  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    fileManager = FileManager.getSingleton(getContext());

    DeviceConnectionListener listener = null;
    Bundle args = getArguments();
    if (args != null) {
      fromDevice = args.getBoolean(ARG_FROM_DEVICE);
      if (fromDevice) {
        listener = this;
      }
    }
    usbConn = UsbConnection.getSingleton(getContext(), listener);

    mainHandler = new Handler(getContext().getMainLooper());
  }
コード例 #2
0
 @Override
 public void onDestroy() {
   usbConn.removeListener(this);
   usbConn = null;
   super.onDestroy();
 }