title: Is using runOnUiThread inside AsyncTask inefficient and bad?
body: <p>I know it sounds crazy that someone is using runOnUiThread inside AsyncTask. Somehow, it is working for me but I wanna know if it is an acceptable and robust approach or not. Here is the scenario:</p>
  
  <p>I have an app in which after successful login, user is rendered to next screen. In this new screen, 3 different methods are loading different types of data from a web server. These methods are:</p>
  
  <ul>
  <li><p><strong>getMembersForList()</strong> : It loads the list of community members and shows it in a listview.</p></li>
  <li><p><strong>getProfileData()</strong> : It loads the profile of logged in user and shows his name , image etc on the screen.</p></li>
  <li><strong>getNotificationCounts</strong> : It loads the count of new notifications for the user.</li>
  </ul>
  
  <p>I applied 3 different approaches for it :</p>
  
  <p><strong>(1)</strong> Calling all 3 methods simply in onCreate i.e. no exclusive thread is being used for any of the methods . In this case , the transition from login screen to this screen becomes very slow and black screen shows up for some time before this activity shows up.</p>
  
  <p><strong>(2)</strong> Calling  getMembersForList() on UI thread and the other 2 methods on exclusive threads. In this case transition becomes fast and list shows up quickly but Notification counts and username etc. don't show up because WrongThreadException occurs saying that this thread can't touch other thread's views (TextViews for username, notification count etc. which are declared globally) . The same thing happens when I start these threads from an AsyncTask as well.</p>
  
  <p><strong>(3)</strong> Calling getMembersForList() on UI thread and then starting an AsyncTask in which the other 2 methods are being called in "runOnUiThread" inside doInBackground() method. This solves both the above issues. Now the screen transition is faster and the WrongThread exception is also not occuring. </p>
  
  <p>So far the <strong>approach-(3)</strong> is working good for me but I am not sure if this is the right way to do it because runOnUiThread and AsyncTask are 2 completely opposite things. Can anyone please clear my doubts about this scenario. Thanx in advance.</p>