user1162766
user1162766

Reputation:

Can't get Holo look and feel with ProgressDialog using Holoeverywhere

I have imported the libraries, there are no errors or warnings but I can't get it working.

This is my ProgressDialog code:

pDialog = new ProgressDialog(MyActivity.this);
pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pDialog.setMessage("Message");
pDialog.setCancelable(false);
pDialog.show();

What I've tried:

I don't know what I'm missing or why it isn't working. Can you please help me?

Upvotes: 2

Views: 2979

Answers (4)

Kostas Drak
Kostas Drak

Reputation: 3260

It also works like this for me.

pDialog = new ProgressDialog(MainActivity.this, ProgressDialog.THEME_DEVICE_DEFAULT_DARK);

You can see the different layouts you may wanna see on a progress dialog in here. It inherits those styles from alert dialog.

http://developer.android.com/reference/android/app/ProgressDialog.html

Upvotes: 2

JeffMeJones
JeffMeJones

Reputation: 364

ProgressDialog progressDialog;

if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB){
   progressDialog = new ProgressDialog(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Light_Dialog));
}else{
   progressDialog = new ProgressDialog(context);
}

progressDialog.setMessage("Loading....");
progressDialog.show();

Upvotes: 5

nicous
nicous

Reputation: 411

Its working for me with this code:

ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setIndeterminate(true);
progressDialog.setMessage(message);
progressDialog.show();

Make sure your activity extends org.holoeverywhere.app.Activity; and that your not passing application context to the progresdialog constructor.

Note: I'm not importing holoeverywhere progressdialog but android.app.ProgressDialog;

Upvotes: 2

Corey Scott
Corey Scott

Reputation: 2440

I haven't had a change to use HoloEverywhere but it requires ActionBarSherlock so could try changing the style to Theme.Sherlock.Light or use it as a base. Something like:

<style name="AppTheme" parent="Theme.Sherlock.Light">
</style>

If that doesn't work just double check that you are using the org.holoeverywhere.app.***Activity imports.

Upvotes: 1

Related Questions