Q:

Android Progress dialog within listview

My app is designed as follows:
Main Activity uses action bars
First tab is a fragment that is split into 3 sections
| Linear Layout containing List view |   |Linear Layout containing List View  |   | Linear Layout containing media controls and image view|
I have two AsyncTasks within this activity, one that fills the centre list view, the other that starts with the media controls to fill the image view (album art).
Both of these are working well.  The List view AsyncTask throws a progress dialog spinning wheel.  This is coming up in the centre of the screen.  I understand that I can put this spinner into the top right of the application.  But can i place it either in the top right of the list views linear layout, or centred at the back of the linear layout?  That way it would be unobtrusive yet obvious what the progress bar applied to?
Thanks in advance

A:

I understand that I can put this spinner into the top right of the
  application. But can i place it either in the top right of the list
  views linear layout, or centred at the back of the linear layout?

If you can calculate the position of the view, you would probably be able to position the ProgressDialog where you want(for example see this question I answered Change position of progressbar in code). Also, keep in mind, that this could be very counter intuitive for the user who would see the screen for the dialog and the dialog placed at some weird position(he may not make the correlation between the position of the ProgressDialog and the view for which the data is loaded).
Another option could be to modify the current layout for the ListView part to add on top an initial gone FrameLayout(which will cover the entire ListView)  with a background that simulates the background for a screen with a Dialog(this FrameLayout will contain a ProgressBar placed where you want). This FrameLayout would be made visible when the AsyncTask kicks in(it may be wise to block the touch events for the underlining ListView). This way the user can still do stuff in your app and it has a clear indication for the View that is loading its data. Of course this will work well if it's possible for the user to work with the other data independently from the loading ListView.

