title: Circle Progress Bar on Fragment is not showing progress
body: <p>I'm trying to show feedback the percentage of which they have downloaded data from a server.</p>
  
  <p>The flow goes something like this:</p>
  
  <p><code>LoginActivity</code>
   - onSuccess, call <code>Service</code> to download data
   - while <code>Service</code> is working, I've already switched the user to <code>HomeActivity</code></p>
  
  <p><code>HomeActivity</code>
    -This activities layout holds a Fragment I created called <code>LoadingFragment</code>
    -There is a method in <code>LoadingFragment</code> that is <code>subscribed</code> to an event that is posted by the <code>Service</code></p>
  
  <p>My problem is that the Fragment UI is not changing at all whenever an event has been posted. </p>
  
  <p>I logged everything, and I can see the event posting the correct data but the data is not being reflected on the UI.</p>
  
  <p>Below is my <code>Service</code>:</p>
  
  <pre><code>@Override
  public int onStartCommand(Intent intent, int flags, final int startId) {
  
      Integer id = intent.getIntExtra("id", 0);
      //do sync here
      Log.i(LOG_TAG, "Make rest call to retrieve all r for id: " + id);
      mRestClient.getApiService().getR(id, new Callback&lt;List&lt;R&gt;&gt;() {
          @Override
          public void success(List&lt;R&gt; rResponse, Response response) {
              Integer outstanding = routeResponse.size();
              Integer percentage;
              LoadingEvent loadingEvent = new LoadingEvent();
              SyncEvent syncEvent = new SyncEvent();
  
              Log.i(LOG_TAG, "Callback success r");
              System.out.println("yohellotest");
              Log.i(LOG_TAG, "Begin insertion");
  
              DaoMaster daoMaster = MyApp.getDaoMaster();
              DaoSession session = daoMaster.newSession();
              SQLiteDatabase db = session.getDatabase();
              RDao rDao = session.getRDao();
              WDao wDao = session.getWDao();
              JDao jDao = session.getJDao();
  
              Log.i(LOG_TAG, "--Beginning Transaction--");
              //db.beginTransaction();
              try {
                  int counter = 0;
                  for(int i = 0; i &lt; rResponse.size(); i++) {
                      R r = rResponse.get(i);
                      rDao.insert(r);
                      Log.i(LOG_TAG, "inserted r: " + r.getId());
  
                      for(int j = 0; j &lt; r.getW().size(); j++) {
                          W w = r.getW().get(j);
                          wDao.insert(w);
                          Log.i(LOG_TAG, "inserted w: " + w.getId());
  
                          for(int k = 0; k &lt; w.getJ().size(); k++) {
                              J j = w.getJ().get(k);
                              jDao.insert(j);
                              Log.i(LOG_TAG, "inserted j: " + j.getJId());
                          }
                      }
                      counter += 1;
                      percentage = (int) Math.floor((double) counter / outstanding * 100);
                      loadingEvent.setPercentage(percentage);
                      bus.post(loadingEvent);
  
                  }
                  Log.i(LOG_TAG, "Finished inserting");
                  //db.setTransactionSuccessful();
              } catch (Exception e) {
                  Log.i(LOG_TAG, "Exception happened " + e.getMessage().toString());
                  System.out.println("yo something happened, but I don't know what");
              } finally {
                  Log.i(LOG_TAG, "--Closing transaction--");
                  //db.endTransaction();
  
              }
  
              syncEvent.setIsSuccess(true);
              syncEvent.setStatus(200);
              bus.post(syncEvent);
  
          }
  
          @Override
          public void failure(RetrofitError error) {
              Log.i(LOG_TAG, "Rest call failed for this api");
              System.out.println("failtests");
  
          }
  
      });
  
      return START_STICKY;
  }
  </code></pre>
  
  <p><code>Fragment</code> Subscribed Method</p>
  
  <pre><code>@Subscribe
  public void loadingResponse(final LoadingEvent loadingEvent) {
      Log.i(LOG_TAG, "Response from loading: " + loadingEvent.getPercentage());
  
      if(getActivity() == null)
          return;
      textTest.setText(loadingEvent.getPercentage().toString());
      getActivity().runOnUiThread(new Runnable() {
          @Override
          public void run() {
              Log.i(LOG_TAG, "Updating ui for loading text" + loadingEvent.getPercentage().toString());
              mCircularProgressBar.setProgress(loadingEvent.getPercentage());
              textTest.setText(loadingEvent.getPercentage().toString());
          }
      });
  
  }
  </code></pre>
  
  <p>When I check my Logs, I see everything coming in fine, but the UI is not reflecting it. What am I missing here?</p>
  
  <p><strong>EDIT</strong>
  Forgot to mention. I'm using this library for my circle progress bar:</p>
  
  <p><a href="https://github.com/lsjwzh/MaterialLoadingProgressBar" rel="nofollow">CircleProgressBar</a></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As of today, I still have yet to figure this out. I also noticed that my adapter is not being updated when the service posts the event. Previously, the <code>context</code> used to <code>startService()</code> was the <code>getApplicationContext()</code> from the <code>LoginActivity</code>. I thought this might have been a problem so I changed it to get the instance of the <code>HomeActivity</code> instead. I thought that firing the service from my <code>HomeActivity</code> would have solved the problem, but I'm still getting the same results unfortunately.</p>