title: How can I make an http request inside an android content provider?
body: <p>I am trying to build an android app that makes an http request to a JSON API in order to create and fill a local SQLite DB while at the same time exposing that db through a content provider.</p>
  
  <p>Context :
  I am just starting to learn android so I first got it to work without the content provider using a custom version of an AsyncTaskLoader where I did the async requests and wrote directly to the db.</p>
  
  <p>When I was trying to get it to work with a content provider I tried to get rid of the CustomAsyncTaskLoader so I could use a CursorLoader.
  I made the initial http request as an async task inside the onCreate() method of the content provider, but after several hours of looking for the problem it seems like if the async task must be called from the main UI thread or the onPostExecute() method doesn't get called.</p>
  
  <p>All these hours looking for an answer to this lead me to guess that there must be a better way to do this...</p>
  
  <p>I appreciate all the help in advance.</p>