Retrofit "IllegalStateException: Already executed"
<p>I have a Retrofit network call that id like to run every 5 seconds. My current code:</p>

<pre><code>Handler h = new Handler();
int delay = 5000; //milliseconds

h.postDelayed(new Runnable() {
    public void run() {
        call.enqueue(new Callback&lt;ApiResponse&gt;() {
            @Override
            public void onResponse(Response&lt;ApiResponse&gt; response) {
                Log.d("api", "response: " + response.body().getPosition().getLatitude().toString());
            }

            @Override
            public void onFailure(Throwable t) {

            }
        });
        h.postDelayed(this, delay);
    }
}, delay);
</code></pre>

<p>This runs once, but then throws the following:</p>

<blockquote>
  <p>java.lang.IllegalStateException: Already executed.
          at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:52)
          at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall.enqueue(ExecutorCallAdapterFactory.java:57)
          at orbyt.project.MyFragment$1.run(MyFragment.java:93)</p>
</blockquote>

<p>Whats the issue here?</p>

<p>As a bonus: whats a better way to handle this? Ill be updating a map every update. I was thinking about trying to use Rx but not sure if this is an appropriate use-case, or how to implement it.</p>