commit b2a2d2f17aadd62a6d177757a0ddfaf17f5cd9e8
Author: Adam Menz <adam.menz@rackspace.com>
Date:   Wed Aug 3 14:11:02 2011 -0500

    cleaned up code (made more activities extend cloud(list)activity

diff --git a/res/layout/listaccountcell.xml b/res/layout/listaccountcell.xml
index 6172cd6..fd3f232 100644
--- a/res/layout/listaccountcell.xml
+++ b/res/layout/listaccountcell.xml
@@ -4,9 +4,9 @@
   android:layout_width="fill_parent"
   android:orientation="horizontal" android:layout_height="64dip">
     <ImageView android:id="@+id/account_type_icon" android:layout_gravity="center" android:layout_height="fill_parent" android:layout_width="wrap_content" android:maxHeight="30dp" android:maxWidth="30dp" android:layout_marginLeft="10dip"></ImageView>
-    <TableLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_marginLeft="10dip" android:id="@+id/tableLayout1" android:layout_width="190dip">
+    <TableLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_marginLeft="10dip" android:id="@+id/tableLayout1" android:layout_width="fill_parent" android:layout_marginRight="10dip">
         <TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1" android:layout_width="wrap_content">
-            <TextView android:textSize="24sp" android:textColor="#FFFFFF" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="5px" android:id="@+id/label"></TextView>
+            <TextView android:textSize="24sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:layout_marginTop="5px" android:id="@+id/label"></TextView>
         </TableRow>
         <TableRow android:layout_height="wrap_content" android:id="@+id/tableRow2" android:layout_width="wrap_content">
             <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/sublabel"></TextView>
diff --git a/res/layout/nonodescell.xml b/res/layout/nonodescell.xml
new file mode 100644
index 0000000..43b305a
--- /dev/null
+++ b/res/layout/nonodescell.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="264dip"
+    >
+    
+    <TextView android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="125px"
+        android:textColor="#FFFFFF"
+        android:gravity="center"
+        
+        android:textSize="24sp" android:text="No Nodes" android:id="@+id/no_nodes_label"/>
+
+    <TextView android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10px"
+        android:textColor="#FFFFFF"
+        android:gravity="center"
+        android:textSize="12sp" android:text="Add an external node or create a Cloud Server." android:id="@+id/no_nodes_sublabel"/>
+        
+</LinearLayout>
diff --git a/res/values/style.xml b/res/values/style.xml
index bd4039d..f312b41 100644
--- a/res/values/style.xml
+++ b/res/values/style.xml
@@ -8,7 +8,7 @@
     <item name="android:windowTitleStyle">@null</item>
     <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
     <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
-    <item name="android:backgroundDimEnabled">false</item>
-    <item name="android:background">@android:color/black</item>
+    <item name="android:backgroundDimEnabled">false</item> 
+    <item name="android:background">@android:color/black</item> 
 </style>
 </resources>
diff --git a/src/com/rackspace/cloud/loadbalancer/api/client/LoadBalancerManager.java b/src/com/rackspace/cloud/loadbalancer/api/client/LoadBalancerManager.java
index a5e4c19..91f3c2e 100644
--- a/src/com/rackspace/cloud/loadbalancer/api/client/LoadBalancerManager.java
+++ b/src/com/rackspace/cloud/loadbalancer/api/client/LoadBalancerManager.java
@@ -46,7 +46,6 @@ public class LoadBalancerManager extends EntityManager {
 	}
 
 	public LoadBalancer getLoadBalancerById(long id) throws LoadBalancersException {
-		Log.d("info", "the id is " + id);
 		LoadBalancer loadBalancer = null;
 		//First try DFW
 		try{
@@ -72,7 +71,7 @@ public class LoadBalancerManager extends EntityManager {
 		if(loadBalancer == null){
 			try{
 				loadBalancer = getLoadBalancerById(id, Account.getLoadBalancerLONUrl());
-				loadBalancer.setRegion("ORD");
+				loadBalancer.setRegion("LON");
 			}
 			catch(LoadBalancersException lbe){
 				throw lbe;
diff --git a/src/com/rackspacecloud/android/AddNodesActivity.java b/src/com/rackspacecloud/android/AddNodesActivity.java
index 4415820..81f8214 100644
--- a/src/com/rackspacecloud/android/AddNodesActivity.java
+++ b/src/com/rackspacecloud/android/AddNodesActivity.java
@@ -194,7 +194,7 @@ public class AddNodesActivity extends CloudListActivity {
 	private void displayNoServersCell() {
 		String a[] = new String[1];
 		a[0] = "No Nodes";
-		setListAdapter(new ArrayAdapter<String>(this, R.layout.noserverscell, R.id.no_servers_label, a));
+		setListAdapter(new ArrayAdapter<String>(this, R.layout.nonodescell, R.id.no_nodes_label, a));
 		getListView().setTextFilterEnabled(true);
 		getListView().setDividerHeight(0); // hide the dividers so it won't look like a list row
 		getListView().setItemsCanFocus(false);
diff --git a/src/com/rackspacecloud/android/CloudActivity.java b/src/com/rackspacecloud/android/CloudActivity.java
index e9590ad..11716ef 100644
--- a/src/com/rackspacecloud/android/CloudActivity.java
+++ b/src/com/rackspacecloud/android/CloudActivity.java
@@ -80,6 +80,23 @@ public abstract class CloudActivity extends GaActivity{
 		
 	}
 	
+	@Override
+	protected void onStart(){
+		super.onStart();
+		if(isLoading){
+			showDialog();
+		}
+	}
+	
+	@Override
+	protected void onStop(){
+		super.onStop();
+		if(isLoading){
+			hideDialog();
+			isLoading = true;
+		}
+	}
+	
 	protected final void showAlert(String title, String message) {
 		try {
 			AlertDialog alert = new AlertDialog.Builder(this).create();
@@ -152,6 +169,7 @@ public abstract class CloudActivity extends GaActivity{
 		if(pDialog == null || !pDialog.isShowing()){
 			isLoading = true;
 			pDialog = new ProgressDialog(this);
+			pDialog.setProgressStyle(R.style.NewDialog);
 
 			/*
 			 * if back is pressed while dialog is showing it will 
@@ -163,7 +181,6 @@ public abstract class CloudActivity extends GaActivity{
 					finish();
 				}
 			});
-
 			pDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
 			pDialog.show();
 			pDialog.setContentView(new ProgressBar(this), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
diff --git a/src/com/rackspacecloud/android/CloudListActivity.java b/src/com/rackspacecloud/android/CloudListActivity.java
index 6df3031..e3f3204 100644
--- a/src/com/rackspacecloud/android/CloudListActivity.java
+++ b/src/com/rackspacecloud/android/CloudListActivity.java
@@ -33,7 +33,7 @@ import android.widget.Toast;
 
 public class CloudListActivity extends GaListActivity{
 
-	protected Context context;
+	private Context context;
 	private boolean isLoading;
 	private ProgressDialog pDialog;
 	
@@ -145,7 +145,8 @@ public class CloudListActivity extends GaListActivity{
 		if(pDialog == null || !pDialog.isShowing()){
 			isLoading = true;
 			pDialog = new ProgressDialog(this);
-
+			pDialog.setProgressStyle(R.style.NewDialog);
+			
 			/*
 			 * if back is pressed while dialog is showing it will 
 			 * still finish the activity
diff --git a/src/com/rackspacecloud/android/ContainerObjectDetails.java b/src/com/rackspacecloud/android/ContainerObjectDetails.java
index 12cda98..9ce5cee 100644
--- a/src/com/rackspacecloud/android/ContainerObjectDetails.java
+++ b/src/com/rackspacecloud/android/ContainerObjectDetails.java
@@ -5,34 +5,20 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.impl.client.BasicResponseHandler;
 import org.apache.http.util.EntityUtils;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
 
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Environment;
-import android.util.Log;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -45,7 +31,6 @@ import com.rackspace.cloud.files.api.client.ContainerObjectManager;
 import com.rackspace.cloud.files.api.client.ContainerObjects;
 import com.rackspace.cloud.servers.api.client.CloudServersException;
 import com.rackspace.cloud.servers.api.client.http.HttpBundle;
-import com.rackspace.cloud.servers.api.client.parsers.CloudServersFaultXMLParser;
 
 /** 
  * 
@@ -53,9 +38,7 @@ import com.rackspace.cloud.servers.api.client.parsers.CloudServersFaultXMLParser
  *
  */
 
-//doesn't extend cloud activity because of the complex
-//dialog management needed for the listeners
-public class ContainerObjectDetails extends GaActivity {
+public class ContainerObjectDetails extends CloudActivity {
 
 	private static final int deleteObject = 0;
 	private final String DOWNLOAD_DIRECTORY = "/RackspaceCloud";
@@ -71,9 +54,6 @@ public class ContainerObjectDetails extends GaActivity {
 	private double kiloBytes;
 	public Button previewButton;
 	public Button downloadButton;
-	public Context context;
-	private boolean displayDialog;
-	private ProgressDialog dialog;
 	private Boolean isDownloaded;
 	private AndroidCloudApplication app;
 	private DeleteObjectListenerTask deleteObjTask;
@@ -84,18 +64,14 @@ public class ContainerObjectDetails extends GaActivity {
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		trackPageView(PAGE_STORAGE_OBJECT);
-		
-		context = getApplicationContext();
 
 		objects = (ContainerObjects) this.getIntent().getExtras().get("container");
 		containerNames =  (String) this.getIntent().getExtras().get("containerNames");
 		cdnURL = (String) this.getIntent().getExtras().get("cdnUrl");
 		cdnEnabled = (String) this.getIntent().getExtras().get("isCdnEnabled");
 
-
 		setContentView(R.layout.viewobject);       
 		restoreState(savedInstanceState);
-
 	}
 
 	@Override
@@ -103,28 +79,16 @@ public class ContainerObjectDetails extends GaActivity {
 		super.onSaveInstanceState(outState);
 		outState.putSerializable("container", objects);
 		outState.putBoolean("isDownloaded", isDownloaded);
-		outState.putBoolean("displayDialog", displayDialog);
-		
-		if(displayDialog){
-			hideDialog();
-			displayDialog = true;
-		}
 	}
 
-	private void restoreState(Bundle state) {
-		
+	protected void restoreState(Bundle state) {
+		super.restoreState(state);
 		/*
 		 * need reference to the app so you can access curDirFiles
 		 * as well as processing status
 		 */
 		app = (AndroidCloudApplication)this.getApplication();
 
-		if (state != null && state.containsKey("displayDialog") && state.getBoolean("displayDialog")) {
-    		showDialog();
-    	} else {
-    		hideDialog();
-    	}
-		
 		if (state != null && state.containsKey("container")) {
 			objects = (ContainerObjects) state.getSerializable("container");
 		}
@@ -162,25 +126,11 @@ public class ContainerObjectDetails extends GaActivity {
 			downloadObjTask.execute();
 		}
 	}
-	
-	@Override
-	protected void onStart(){
-		super.onStart();
-		if(displayDialog){
-			showDialog();
-		}
-	}
 
-	
 	@Override
 	protected void onStop(){
 		super.onStop();
 
-		if(displayDialog){
-			hideDialog();
-			displayDialog = true;
-		}
-
 		/*
 		 * Need to stop running listener task
 		 * if we exit
@@ -221,25 +171,7 @@ public class ContainerObjectDetails extends GaActivity {
 		//Last Modification date
 		String strDate = objects.getLastMod();
 		strDate = strDate.substring(0, strDate.indexOf('T'));
-		/*
-		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.ssssss");
-		Date dateStr = null;
-		try {
-			dateStr = formatter.parse(strDate);
-		} catch (ParseException e1) {
-			e1.printStackTrace();
-		}
-		String formattedDate = formatter.format(dateStr);
 
-		Date date1 = null;
-		try {
-			date1 = formatter.parse(formattedDate);
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}      
-		formatter = new SimpleDateFormat("MMM-dd-yyyy");
-		formattedDate = formatter.format(date1);
-		*/
 		TextView lastmod = (TextView) findViewById(R.id.view_file_modification);
 		lastmod.setText(strDate);    	  
 
@@ -272,16 +204,6 @@ public class ContainerObjectDetails extends GaActivity {
 		}
 	}
 
-	private void showAlert(String title, String message) {
-		AlertDialog alert = new AlertDialog.Builder(this).create();
-		alert.setTitle(title);
-		alert.setMessage(message);
-		alert.setButton("OK", new DialogInterface.OnClickListener() {
-			public void onClick(DialogInterface dialog, int which) {
-				return;
-			} }); 
-		alert.show();
-	}
 	//Create the Menu options
 	@Override 
 	public boolean onCreateOptionsMenu(Menu menu) {
@@ -433,64 +355,11 @@ public class ContainerObjectDetails extends GaActivity {
 
 	//Task's
 
-	private CloudServersException parseCloudServersException(HttpResponse response) {
-		CloudServersException cse = new CloudServersException();
-		try {
-			BasicResponseHandler responseHandler = new BasicResponseHandler();
-			String body = responseHandler.handleResponse(response);
-			CloudServersFaultXMLParser parser = new CloudServersFaultXMLParser();
-			SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
-			XMLReader xmlReader = saxParser.getXMLReader();
-			xmlReader.setContentHandler(parser);
-			xmlReader.parse(new InputSource(new StringReader(body)));		    	
-			cse = parser.getException();		    	
-		} catch (ClientProtocolException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (IOException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (ParserConfigurationException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (SAXException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (FactoryConfigurationError e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		}
-		return cse;
-	}
-
-	private void startFileError(String message, HttpBundle bundle){
-		Intent viewIntent = new Intent(getApplicationContext(), ServerErrorActivity.class);
-		viewIntent.putExtra("errorMessage", message);
-		viewIntent.putExtra("response", bundle.getResponseText());
-		viewIntent.putExtra("request", bundle.getCurlRequest());
-		startActivity(viewIntent);
-	}
-	
-	private void showDialog() {
-		if(dialog == null || !dialog.isShowing()){
-			displayDialog = true;
-			dialog = ProgressDialog.show(ContainerObjectDetails.this, "", "Loading...", true);
-		}
-    }
-    
-    private void hideDialog() {
-    	if(dialog != null){
-    		dialog.dismiss();
-    	}
-    	displayDialog = false;
-    }
-
 	private class ContainerObjectDeleteTask extends AsyncTask<Void, Void, HttpBundle> {
 
 		private CloudServersException exception;
 
 		protected void onPreExecute(){
-			//dialog = ProgressDialog.show(ContainerObjectDetails.this, "", "Deleting...", true);
 			showDialog();
 			app.setDeleteingObject(true);
 			deleteObjTask = new DeleteObjectListenerTask();
@@ -501,7 +370,7 @@ public class ContainerObjectDetails extends GaActivity {
 		protected HttpBundle doInBackground(Void... arg0) {
 			HttpBundle bundle = null;	
 			try {
-				bundle = (new ContainerObjectManager(context)).deleteObject(containerNames, objects.getCName() );
+				bundle = (new ContainerObjectManager(getContext())).deleteObject(containerNames, objects.getCName() );
 			} catch (CloudServersException e) {
 				exception = e;
 			}
@@ -511,24 +380,23 @@ public class ContainerObjectDetails extends GaActivity {
 
 		@Override
 		protected void onPostExecute(HttpBundle bundle) {
-			//dialog.dismiss();
 			app.setDeleteingObject(false);
 			hideDialog();
 			HttpResponse response = bundle.getResponse();
 			if (response != null) {
 				int statusCode = response.getStatusLine().getStatusCode();
 				if (statusCode == 204) {
-					//handled by listner
+					//handled by listener
 				} else {
 					CloudServersException cse = parseCloudServersException(response);
 					if ("".equals(cse.getMessage())) {
-						startFileError("There was a problem deleting your File.", bundle);
+						showError("There was a problem deleting your File.", bundle);
 					} else {
-						startFileError("There was a problem deleting your file: " + cse.getMessage(), bundle);
+						showError("There was a problem deleting your file: " + cse.getMessage(), bundle);
 					}
 				}
 			} else if (exception != null) {
-				startFileError("There was a problem deleting your file: " + exception.getMessage(), bundle);				
+				showError("There was a problem deleting your file: " + exception.getMessage(), bundle);				
 			}			
 		}
 	}
@@ -549,7 +417,7 @@ public class ContainerObjectDetails extends GaActivity {
 		protected HttpBundle doInBackground(Void... arg0) {
 			HttpBundle bundle = null;	
 			try {
-				bundle = (new ContainerObjectManager(context)).getObject(containerNames, objects.getCName());
+				bundle = (new ContainerObjectManager(getContext())).getObject(containerNames, objects.getCName());
 			} catch (CloudServersException e) {
 				exception = e;
 			}
@@ -567,32 +435,16 @@ public class ContainerObjectDetails extends GaActivity {
 					setResult(Activity.RESULT_OK);
 					HttpEntity entity = response.getEntity();
 					app.setDownloadedEntity(entity);
-					/*
-					try {
-						if(writeFile(EntityUtils.toByteArray(entity))){
-							downloadButton.setText("Open File");
-							isDownloaded = true;
-						}
-						else{
-							showAlert("Error", "There was a problem downloading your file.");
-						}
-
-					} catch (IOException e) {
-						showAlert("Error", "There was a problem downloading your file.");
-						e.printStackTrace();
-					}
-					*/
-
 				} else {
 					CloudServersException cse = parseCloudServersException(response);
 					if ("".equals(cse.getMessage())) {
-						startFileError("There was a problem downloading your File.", bundle);
+						showError("There was a problem downloading your File.", bundle);
 					} else {
-						startFileError("There was a problem downloading your file: " + cse.getMessage(), bundle);
+						showError("There was a problem downloading your file: " + cse.getMessage(), bundle);
 					}
 				}
 			} else if (exception != null) {
-				startFileError("There was a problem downloading your file: " + exception.getMessage(), bundle);				
+				showError("There was a problem downloading your file: " + exception.getMessage(), bundle);				
 			}			
 		}
 	}
@@ -649,11 +501,9 @@ public class ContainerObjectDetails extends GaActivity {
 		protected void onPostExecute(Void arg1) {
 			hideDialog();
 			try {
-				Log.d("info", "captin starting to write");
 				if(writeFile(EntityUtils.toByteArray(app.getDownloadedEntity()))){
 					downloadButton.setText("Open File");
 					isDownloaded = true;
-					Log.d("info", "captin wrote");
 				}
 				else{
 					showAlert("Error", "There was a problem downloading your file.");
diff --git a/src/com/rackspacecloud/android/ContainerObjectsActivity.java b/src/com/rackspacecloud/android/ContainerObjectsActivity.java
index 22ec92f..5446f51 100644
--- a/src/com/rackspacecloud/android/ContainerObjectsActivity.java
+++ b/src/com/rackspacecloud/android/ContainerObjectsActivity.java
@@ -1,36 +1,21 @@
 package com.rackspacecloud.android;
 
-import java.io.IOException;
-import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Arrays;
 
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
 import org.apache.http.HttpResponse;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.impl.client.BasicResponseHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
 
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
-import android.view.MenuItem;
+import android.view.MenuItem; 
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
@@ -44,7 +29,6 @@ import com.rackspace.cloud.files.api.client.ContainerObjectManager;
 import com.rackspace.cloud.files.api.client.ContainerObjects;
 import com.rackspace.cloud.servers.api.client.CloudServersException;
 import com.rackspace.cloud.servers.api.client.http.HttpBundle;
-import com.rackspace.cloud.servers.api.client.parsers.CloudServersFaultXMLParser;
 
 /**
  * 
@@ -52,9 +36,7 @@ import com.rackspace.cloud.servers.api.client.parsers.CloudServersFaultXMLParser
  * 
  */
 
-//doesn't extend cloud activity because of the complex
-//dialog management needed for the listeners
-public class ContainerObjectsActivity extends GaListActivity {
+public class ContainerObjectsActivity extends CloudListActivity {
 
 	private static final int deleteContainer = 0;
 	private static final int deleteFolder = 1;
@@ -67,11 +49,8 @@ public class ContainerObjectsActivity extends GaListActivity {
 	public Object kiloBytes;
 	public int bConver = 1048576;
 	public int kbConver = 1024;
-	private Context context;
-	private String currentPath;
 	private boolean loadingFiles;
-	private boolean displayDialog;
-	private ProgressDialog dialog;
+	private String currentPath;
 	private AndroidCloudApplication app;
 	private AddObjectListenerTask task;
 	private DeleteObjectListenerTask deleteObjTask;
@@ -82,8 +61,6 @@ public class ContainerObjectsActivity extends GaListActivity {
 		super.onCreate(savedInstanceState);
 		trackPageView(PAGE_FOLDER);
 		container = (Container) this.getIntent().getExtras().get("container");
-		Log.v(LOG, "CDNEnabled:" + container.isCdnEnabled());
-		context = getApplicationContext();
 		if (container.isCdnEnabled() == true) {
 			cdnEnabledIs = "true";
 		} else {
@@ -102,36 +79,19 @@ public class ContainerObjectsActivity extends GaListActivity {
 		//current path represents where you have "navigated" to
 		outState.putString("path", currentPath);
 		
-		//stores state if you are loading or not 
 		outState.putBoolean("loadingFiles", loadingFiles);
-		
-		//stores whether dialog is showing or not
-		outState.putBoolean("displayDialog", displayDialog);
-		
-		//need to set authenticating back to true because it is set to false
-		//in hideDialog()
-		if(displayDialog){
-			hideDialog();
-			displayDialog = true;
-		}
 	}
 
 
 
-	private void restoreState(Bundle state) {
-		
+	protected void restoreState(Bundle state) {
+		super.restoreState(state);
 		
 		/*
 		 * need reference to the app so you can access curDirFiles
 		 * as well as processing status
 		 */
 		app = (AndroidCloudApplication)this.getApplication();
-
-		if (state != null && state.containsKey("displayDialog") && state.getBoolean("displayDialog")) {
-    		showDialog();
-    	} else {
-    		hideDialog();
-    	}
 		
 		if(state != null){
 			if(state.containsKey("path")){
@@ -187,23 +147,9 @@ public class ContainerObjectsActivity extends GaListActivity {
 	}
 	
 	@Override
-	protected void onStart(){
-		super.onStart();
-		if(displayDialog){
-			showDialog();
-		}
-	}
-
-	
-	@Override
 	protected void onStop(){
 		super.onStop();
 
-		if(displayDialog){
-			hideDialog();
-			displayDialog = true;
-		}
-
 		/*
 		 * Need to stop running listener task
 		 * if we exit
@@ -343,26 +289,6 @@ public class ContainerObjectsActivity extends GaListActivity {
 		getListView().setItemsCanFocus(false);
 	}
 
-
-	private void showAlert(String title, String message) {
-		// Can't create handler inside thread that has not called
-		// Looper.prepare()
-		// Looper.prepare();
-		try {
-			AlertDialog alert = new AlertDialog.Builder(this).create();
-			alert.setTitle(title);
-			alert.setMessage(message);
-			alert.setButton("OK", new DialogInterface.OnClickListener() {
-				public void onClick(DialogInterface dialog, int which) {
-					return;
-				}
-			});
-			alert.show();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
 	/* just get the last part of the filename
 	 * so the entire file path does not show
 	 */
@@ -579,59 +505,6 @@ public class ContainerObjectsActivity extends GaListActivity {
 		
 	}
 
-	private CloudServersException parseCloudServersException(
-			HttpResponse response) {
-		CloudServersException cse = new CloudServersException();
-		try {
-			BasicResponseHandler responseHandler = new BasicResponseHandler();
-			String body = responseHandler.handleResponse(response);
-			CloudServersFaultXMLParser parser = new CloudServersFaultXMLParser();
-			SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
-			XMLReader xmlReader = saxParser.getXMLReader();
-			xmlReader.setContentHandler(parser);
-			xmlReader.parse(new InputSource(new StringReader(body)));
-			cse = parser.getException();
-		} catch (ClientProtocolException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (IOException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (ParserConfigurationException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (SAXException e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		} catch (FactoryConfigurationError e) {
-			cse = new CloudServersException();
-			cse.setMessage(e.getLocalizedMessage());
-		}
-		return cse;
-	}
-
-	private void startFileError(String message, HttpBundle bundle){
-		Intent viewIntent = new Intent(getApplicationContext(), ServerErrorActivity.class);
-		viewIntent.putExtra("errorMessage", message);
-		viewIntent.putExtra("response", bundle.getResponseText());
-		viewIntent.putExtra("request", bundle.getCurlRequest());
-		startActivity(viewIntent);
-	}
-	
-	private void showDialog() {
-		if(dialog == null || !dialog.isShowing()){
-			displayDialog = true;
-			dialog = ProgressDialog.show(ContainerObjectsActivity.this, "", "Loading...", true);
-		}
-    }
-    
-    private void hideDialog() {
-    	if(dialog != null){
-    		dialog.dismiss();
-    	}
-    	displayDialog = false;
-    }
-
 	class FileAdapter extends ArrayAdapter<ContainerObjects> {
 		FileAdapter() {
 			super(ContainerObjectsActivity.this,
@@ -669,16 +542,17 @@ public class ContainerObjectsActivity extends GaListActivity {
 	AsyncTask<String, Void, ArrayList<ContainerObjects>> {
 
 		private CloudServersException exception;
+		
 		protected void onPreExecute(){
 			showDialog();
-			loadingFiles = true; 
+			loadingFiles = true;
 		}
 
 		@Override
 		protected ArrayList<ContainerObjects> doInBackground(String... path) {
 			ArrayList<ContainerObjects> files = null;
 			try {
-				files = (new ContainerObjectManager(context)).createList(true,
+				files = (new ContainerObjectManager(getContext())).createList(true,
 						container.getName());
 			} catch (CloudServersException e) {
 				exception = e;
@@ -689,15 +563,14 @@ public class ContainerObjectsActivity extends GaListActivity {
 
 		@Override
 		protected void onPostExecute(ArrayList<ContainerObjects> result) {
+			loadingFiles = false;
 			hideDialog();
 			if (exception != null) {
 				showAlert("Error", exception.getMessage());
 			}
-
 			setFileList(result);
 			loadCurrentDirectoryFiles();
 			displayCurrentFiles();
-			loadingFiles = false;
 		}
 
 	}
@@ -720,7 +593,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 			HttpBundle bundle = null;
 			try {
 				
-				bundle = (new ContainerObjectManager(context)).addObject(container.getName(), currentPath, data[0], data[1]);
+				bundle = (new ContainerObjectManager(getContext())).addObject(container.getName(), currentPath, data[0], data[1]);
 			} catch (CloudServersException e) {
 				exception = e;
 			}
@@ -730,6 +603,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 		@Override
 		protected void onPostExecute(HttpBundle bundle) {
 			app.setAddingObject(false);
+			hideDialog();
 			HttpResponse response = bundle.getResponse();
 			if (response != null) {
 				int statusCode = response.getStatusLine().getStatusCode();
@@ -737,18 +611,16 @@ public class ContainerObjectsActivity extends GaListActivity {
 					setResult(Activity.RESULT_OK);
 					//loading the new files is done by ListenerTask
 				} else {
-					hideDialog();
 					CloudServersException cse = parseCloudServersException(response);
 					if ("".equals(cse.getMessage())) {
-						startFileError("There was a problem deleting your folder.", bundle);
+						showError("There was a problem deleting your folder.", bundle);
 					} else {
-						startFileError("There was a problem deleting your folder: "
+						showError("There was a problem deleting your folder: "
 								+ cse.getMessage(), bundle);
 					}
 				}
 			} else if (exception != null) {
-				hideDialog();
-				startFileError("There was a problem deleting your folder: "
+				showError("There was a problem deleting your folder: "
 						+ exception.getMessage(), bundle);
 			}
 		}
@@ -772,7 +644,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 			HttpBundle bundle = null;
 			try {
 				//subtring because the current directory contains a "/" at the end of the string
-				bundle = (new ContainerObjectManager(context)).deleteObject(container.getName(), currentPath.substring(0, currentPath.length()-1));
+				bundle = (new ContainerObjectManager(getContext())).deleteObject(container.getName(), currentPath.substring(0, currentPath.length()-1));
 			} catch (CloudServersException e) {
 				exception = e;
 			}
@@ -782,29 +654,27 @@ public class ContainerObjectsActivity extends GaListActivity {
 		@Override
 		protected void onPostExecute(HttpBundle bundle) {
 			app.setDeleteingObject(false);
+			hideDialog();
 			HttpResponse response = bundle.getResponse();
 			if (response != null) {
 				int statusCode = response.getStatusLine().getStatusCode();
 				if (statusCode == 409) {
-					hideDialog();
 					showAlert("Error",
 					"Folder must be empty in order to delete");
 				}
 				if (statusCode == 204) {
 					setResult(Activity.RESULT_OK);
 				} else {
-					hideDialog();
 					CloudServersException cse = parseCloudServersException(response);
 					if ("".equals(cse.getMessage())) {
-						startFileError("There was a problem deleting your folder.", bundle);
+						showError("There was a problem deleting your folder.", bundle);
 					} else {
-						startFileError("There was a problem deleting your folder: "
+						showError("There was a problem deleting your folder: "
 								+ cse.getMessage(), bundle);
 					}
 				}
 			} else if (exception != null) {
-				hideDialog();
-				startFileError("There was a problem deleting your folder: "
+				showError("There was a problem deleting your folder: "
 						+ exception.getMessage(), bundle);
 			}
 		}
@@ -816,7 +686,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 		private CloudServersException exception;
 
 		@Override
-		protected void onPreExecute(){
+		protected void onPreExecute(){ 
 			showDialog();
 			app.setDeletingContainer(true);
 			deleteContainerTask = new DeleteContainerListenerTask();
@@ -827,8 +697,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 		protected HttpBundle doInBackground(String... object) {
 			HttpBundle bundle = null;
 			try {
-				
-				bundle = (new ContainerManager(context)).delete(container.getName());
+				bundle = (new ContainerManager(getContext())).delete(container.getName());
 			} catch (CloudServersException e) {
 				exception = e;
 			}
@@ -843,7 +712,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 			if (response != null) {
 				int statusCode = response.getStatusLine().getStatusCode();
 				if (statusCode == 409) {
-					startFileError("Container must be empty in order to delete", bundle);
+					showError("Container must be empty in order to delete", bundle);
 				}
 				if (statusCode == 204) {
 					setResult(Activity.RESULT_OK);
@@ -851,14 +720,14 @@ public class ContainerObjectsActivity extends GaListActivity {
 				} else {
 					CloudServersException cse = parseCloudServersException(response);
 					if ("".equals(cse.getMessage())) {
-						startFileError("There was a problem deleting your container.", bundle);
+						showError("There was a problem deleting your container.", bundle);
 					} else {
-						startFileError("There was a problem deleting your container: "
+						showError("There was a problem deleting your container: "
 								+ cse.getMessage(), bundle);
 					}
 				}
 			} else if (exception != null) {
-				startFileError("There was a problem deleting your server: "
+				showError("There was a problem deleting your server: "
 						+ exception.getMessage(), bundle);
 			}
 		}
@@ -891,6 +760,7 @@ public class ContainerObjectsActivity extends GaListActivity {
 		 */
 		@Override
 		protected void onPostExecute(Void arg1) {
+			hideDialog();
 			loadFiles();
 		}
 	}
diff --git a/src/com/rackspacecloud/android/GaActivity.java b/src/com/rackspacecloud/android/GaActivity.java
index 33f64cb..6c95b60 100644
--- a/src/com/rackspacecloud/android/GaActivity.java
+++ b/src/com/rackspacecloud/android/GaActivity.java
@@ -5,7 +5,6 @@ import com.google.android.apps.analytics.GoogleAnalyticsTracker;
 import android.app.Activity;
 import android.os.Build;
 import android.os.Bundle;
-import android.util.Log;
 
 public class GaActivity extends Activity {
 	
@@ -49,18 +48,13 @@ public class GaActivity extends Activity {
 	
 	public void startTracker(){
 		if(!"google_sdk".equals(Build.PRODUCT) && !"sdk".equals(Build.PRODUCT)){
-			Log.d("tracker", "Creating Tracker");
 			tracker = GoogleAnalyticsTracker.getInstance();
 			tracker.start(Config.WEB_PROPERTY_ID, 20, this);
 		}
-		else{
-			Log.d("tracker", "Not Creating Tracker");
-		}
 	}
 	
 	public void trackPageView(String page){
 		if(tracker != null){
-			Log.d("tracker", "Tracking pageview: " + page);
 			tracker.trackPageView(page);
 		}
 	}
@@ -75,7 +69,6 @@ public class GaActivity extends Activity {
 
 	public void trackEvent(String category, String action, String label, int value){
 		if(tracker != null){
-			Log.d("tracker", "Tracking event: " + category + " " + action);
 			tracker.trackEvent(category, action, label, value);
 		}
 	}
diff --git a/src/com/rackspacecloud/android/GaListActivity.java b/src/com/rackspacecloud/android/GaListActivity.java
index 41460bf..d2e71a1 100644
--- a/src/com/rackspacecloud/android/GaListActivity.java
+++ b/src/com/rackspacecloud/android/GaListActivity.java
@@ -5,7 +5,6 @@ import com.google.android.apps.analytics.GoogleAnalyticsTracker;
 import android.app.ListActivity;
 import android.os.Build;
 import android.os.Bundle;
-import android.util.Log;
 
 public class GaListActivity extends ListActivity {
 
@@ -49,18 +48,13 @@ public class GaListActivity extends ListActivity {
 	
 	public void startTracker(){
 		if(!"google_sdk".equals(Build.PRODUCT) && !"sdk".equals(Build.PRODUCT)){
-			Log.d("tracker", "Creating Tracker");
 			tracker = GoogleAnalyticsTracker.getInstance();
 			tracker.start(Config.WEB_PROPERTY_ID, 20, this);
 		}
-		else{
-			Log.d("tracker", "Not Creating Tracker");
-		}
 	}
 
 	public void trackPageView(String page){
 		if(tracker != null){
-			Log.d("tracker", "Tracking pageview: " + page);
 			tracker.trackPageView(page);
 		}
 	}
@@ -75,7 +69,6 @@ public class GaListActivity extends ListActivity {
 
 	public void trackEvent(String category, String action, String label, int value){
 		if(tracker != null){
-			Log.d("tracker", "Tracking event: " + category + " " + action);
 			tracker.trackEvent(category, action, label, value);
 		}
 	}
diff --git a/src/com/rackspacecloud/android/ListAccountsActivity.java b/src/com/rackspacecloud/android/ListAccountsActivity.java
index 954aafa..e3e25f3 100644
--- a/src/com/rackspacecloud/android/ListAccountsActivity.java
+++ b/src/com/rackspacecloud/android/ListAccountsActivity.java
@@ -38,7 +38,9 @@ import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
+import android.view.WindowManager;
 import android.view.View.OnClickListener;
+import android.view.ViewGroup.LayoutParams;
 import android.view.ViewGroup;
 import android.widget.AdapterView.AdapterContextMenuInfo;
 import android.widget.ArrayAdapter;
@@ -46,6 +48,7 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.ListView;
+import android.widget.ProgressBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -55,7 +58,7 @@ public class ListAccountsActivity extends GaListActivity{
 	private final int PASSWORD_PROMPT = 123;
 	private final String FILENAME = "accounts.data";
 	private static final String PAGE_ROOT = "/Root";
-
+	
 	private boolean authenticating;
 	private ArrayList<Account> accounts;
 	private Intent tabViewIntent;
@@ -405,8 +408,8 @@ public class ListAccountsActivity extends GaListActivity{
 		app.setIsLoggingIn(true);
 		authenticating = true;
 		if(dialog == null || !dialog.isShowing()){
-			dialog = ProgressDialog.show(ListAccountsActivity.this, "", "Authenticating...", true);
-			dialog.setCancelable(true);
+			dialog = new ProgressDialog(this);
+			dialog.setProgressStyle(R.style.NewDialog);
 			dialog.setOnCancelListener(new OnCancelListener() {
 
 				@Override
@@ -415,7 +418,12 @@ public class ListAccountsActivity extends GaListActivity{
 					hideDialog();
 				}
 			});
+			dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+			dialog.show();
+			dialog.setContentView(new ProgressBar(this), new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
 		}
+
+		
 	}
 
 	private void hideDialog() {
diff --git a/src/com/rackspacecloud/android/SharedVipActivity.java b/src/com/rackspacecloud/android/SharedVipActivity.java
index 4d7af6c..da4daf3 100644
--- a/src/com/rackspacecloud/android/SharedVipActivity.java
+++ b/src/com/rackspacecloud/android/SharedVipActivity.java
@@ -169,7 +169,7 @@ public class SharedVipActivity extends CloudListActivity {
 		protected ArrayList<LoadBalancer> doInBackground(Void... arg0) {
 			ArrayList<LoadBalancer> loadBalancers = null;
 			try {
-				loadBalancers = (new LoadBalancerManager(context)).createList();
+				loadBalancers = (new LoadBalancerManager(getContext())).createList();
 			} catch (LoadBalancersException e) {
 				exception = e;
 			}
