@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); }
@Override public void onDestroy() { mGetBlocksAscyn.cancel(true); super.onDestroy(); }