Exemplo n.º 1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(new DeviceRecycleAdapter(DeviceManager.getInstance().getDeviceList()));
  }
Exemplo n.º 2
0
    @Override
    protected Boolean doInBackground(Void... params) {
      // TODO: attempt authentication against a network service.

      try {
        // Simulate network access.
        Thread.sleep(2000);
      } catch (InterruptedException e) {
        return false;
      }

      for (Device device : DeviceManager.getInstance().getDeviceList()) {
        lastIteratedDevice = device;
        Log.d(TAG, device.getTypeOfDevice());
        Log.d(TAG, "Contains: " + mDevice + " = " + device.findAndFilterDevice(mDevice));
        if (device.findAndFilterDevice(mDevice)) {
          return true;
        }
      }

      // TODO: register the new account here.
      return false;
    }