コード例 #1
0
  @Override
  public void loadBlocks() {
    mGetBlocksAscyn = new GetBlocksAsync(this);

    String url = ApiUrls.API_BLOCKS;

    HashMap<String, String> requestHeaders = new HashMap<String, String>();
    requestHeaders.put(Headers.DEVICE_ID, NetworkUtil.getDeviceId(getActivity()));
    requestHeaders.put(Headers.TOKEN, getString(R.string.token));

    Request request =
        new Request.RequestBuilder(url, Request.RequestTypeEnum.GET)
            .setHeaders(requestHeaders)
            .build();

    mGetBlocksAscyn.executeTask(request);
  }
コード例 #2
0
 @Override
 public void onDestroy() {
   mGetBlocksAscyn.cancel(true);
   super.onDestroy();
 }