In my android application, first activity calls REST API to get the list of items using credentials. Now on clicking on any item, item id is passed and second activity is called using intent. This second activity calls the REST API using passing id and shows the list of sub items for that id.
I am using Progress Dialog in first activity. This is working fine. I want this progress dialog also continue in the second activity until sub item list does not display.
Presently progress dialog disappear as the second activity start and a blank screen appears until the sub list does not fetch.
Can anybody guide me how can I continue progress dialog in second activity and dismiss when sub list appears.
There are two options you can use:
Activityis dismissed and then show it again in theonCreatemethod on your secondActivity. As AkashG mentioned in the comments.Activity, you can use one singleActivityinstead of two and change the layout of thatActivityto use the layout of the secondActivityinstead of calling anotherActivity. However, this can be complicated since you will implement the features of your twoActivitiesinto a single one.