How to show loading dialog or Loading spinner in Android - SpartaCode


Make your development faster and easier !

How to show loading dialog or Loading spinner in Android

Its very important to show a loading dialog to user when some process is going in background.
So, lets implement such loading dialog using a util file which can be used in any of your project you do.


How to use ?

Note: First Copy paste file into your project and then follow these steps.

Step 1 : Declare it in your Activity file 

 LoadingSpinner loadingSpinner;

Step 2 : Initialize loadingSpinner as follows in onCreate() method

 loadingSpinner=new LoadingSpinner(this,"Call will be created soon...");

Step 3 : To open or close dialog use following code 



Thank you 
Please like and subscribe


  1. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…

    software testing course in chennai

    1. Great Article android based projects

      Java Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai