I want to create loading progress bar when my activity is starting. I have an activity with ViewFlipper which contains OpenStreetMap and GridView (I’m switching this two views using ViewVlipper ). I want to display loading progress bar just like Foursquare does. I have some SQL queries which are executing for 0.1 – 0.3s but I want my app to be really responsive ;-). I know that I should use AsyncTask and PostExecute etc. But… how can I obtain similar effect to Foursquare app?
What should I move to the postExecute method? Adding adapter with items which were queried from database to the GridView and adding pins to the map? Any ideas how should it should be done?

There are many ways to accomplish this, but one of the easiest may simply be to toggle the visibility of a
ProgressBarthat is defined in your XML layout (one that fills the parent view).I’ve done this in AsyncTasks where I show the
ProgressBarinonPreExecute()and the remove it inonPostExecute()withsetVisibility(View.GONE).