Add the loading screen in starting of the android application

Anil M H picture Anil M H · Jun 28, 2013 · Viewed 106.9k times · Source

My app is loading the start page in 10 seconds. In that time of 10 sec android screen is blank. In that time I want to add the loading screen. How to add it? And tell me in app how to know the starting page is loading? And tell me how to do in my app?

Answer

Brijesh Thakur picture Brijesh Thakur · Jun 28, 2013

use ProgressDialog.

ProgressDialog dialog=new ProgressDialog(context);
dialog.setMessage("message");
dialog.setCancelable(false);
dialog.setInverseBackgroundForced(false);
dialog.show();

hide it whenever your UI is ready with data. call :

dialog.hide();