I suggest you use the progress dialog as well as use the progress bar. For customization, you can also use the run dialog in the process.
Please check the link. Also a link to the official Android blog. Link See Dialog for creating progress , and in this second example, a stream.
Shashank_itmaster
source share