ensuring an async thread runs on the ui thread
<p>I have objects (not on the ui thread) that need to run the async task as internal methods and I want to pass the ui thread to the method and then implement the ui thread on the asynctask that way - is there a way of doing this?</p>

<p>pseudo-code:</p>

<pre><code>      public class EditDetails extends Activity{          
                MyObject obj = new obj;
                obj.syncWithServer(EditDetails.this);
      }

      public class MyObject {
           public void syncWithWerver(EditDetails parent){
                 final class GetUserHttpTask extends AsyncTask&lt;String/* Param */, Boolean /* Progress */, String /* Result */&gt; {
                        @Override
                        protected String doInBackground(String... params) {
                             return "";
                        }
                        @Override
                        protected String onPostExecute(String result) {
                              //this doesn't run
                        }
                 }
           }
      }          
</code></pre>

<p>note: at the moment this isn't working because onPostExecute isn't firing after the doInBackground</p>

<p><strong>EDIT</strong></p>

<p>this code is pseudocode the actual problem is still happening and I have listed it <a href="http://pastebin.com/jW6JpUbg" rel="nofollow">http://pastebin.com/jW6JpUbg</a> <a href="http://pastebin.com/jW6JpUbg" rel="nofollow">here</a>.. basically it gets stuck after running  line 72 on the pastebin in never does onPostExecute</p>
