Changing screen color in ProgressDialog
I have the following code to display a ProgressDialog while data is fetched from the internet:
loading = new ProgressDialog( context, ProgressDialog.STYLE_HORIZONTAL );
loading.setMessage( context.getResources().getString( R.string.loading ) );
loading.setIndeterminate( true );
loading.setCancelable( false );
loading.show();
and it works nicely. There's just one problem: Every other scr开发者_Python百科een in my application has a blue background, and the loading screen has a black background (#000000 by the looks of it). This is particularly annoying when the data download is quick as it appears as a black "flash" to users.
Is there a way to change the black background behind a ProgressDialog (not the dark gray of the ProgressDialog itself)?
If you mean the black background of your activity then, you will have to use the async task and implement doInBackground() API and if you are looking for the background of the progress dialog then you will have to customize your dialog which should not be difficult.
精彩评论