Custom Drawable for ProgressBar/ProgressDialog

I used the following for creating a custom progress bar. File res/drawable/progress_bar_states.xml declares the colors of the different states: <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@android:id/background”> <shape> <gradient android:startColor=”#000001″ android:centerColor=”#0b131e” android:centerY=”0.75″ android:endColor=”#0d1522″ android:angle=”270″ /> </shape> </item> <item android:id=”@android:id/secondaryProgress”> <clip> <shape> <gradient android:startColor=”#234″ android:centerColor=”#234″ android:centerY=”0.75″ android:endColor=”#a24″ android:angle=”270″ /> </shape> </clip> </item> <item android:id=”@android:id/progress”> <clip> <shape> <gradient android:startColor=”#144281″ android:centerColor=”#0b1f3c” android:centerY=”0.75″ … Read more

ProgressDialog in AsyncTask

/** * this class performs all the work, shows dialog before the work and dismiss it after */ public class ProgressTask extends AsyncTask<String, Void, Boolean> { public ProgressTask(ListActivity activity) { this.activity = activity; dialog = new ProgressDialog(activity); } /** progress dialog to show user that the backup is processing. */ private ProgressDialog dialog; /** application … Read more