title: Intent service for retrofit call
body: <p>I have created an IntentService as follows:</p>
  <pre><code>      @Override
         protected void onHandleIntent(@Nullable Intent intent) {
                 // DB opertaion
                  list.addAll(users);
            for (int i = 0; i &lt; list.size(); i++)
                 RestClient.getInstance(this).get().sendReading(list.get(i)).enqueue(this);
              }
             //retrofit callback
          @Override
           public void onResponse(@NonNull Call&lt;CommonResponse&gt; call, @NonNull 
            Response&lt;CommonResponse&gt; response) {
                  if (response.body().getStatusCode() == Constants.SUCCESS_CODE) {
                   //DB insert operation
                  }
              }  
  </code></pre>
  <hr />
  <p>In the above code, I'm using realm database and which has multiple records, I take few records and hit API in one by one using retrofit and I am using intent service, when I got a successful result then I update my DB.Here my problem is when I call the intent service. <strong>it hit only one record, but I pass multiple records</strong>.</p>
  <p>I'm calling this service from onResume method of an Activity. So whenever the activity resumes this service is called :</p>
  <pre><code>    @Override
      protected void onResume() {
  
      super.onResume();
  
      Intent updateService = new Intent(HomeActivity.this, UpdateService.class);
      startService(UpdateService);
  
  }
  </code></pre>