Revision 51938302 src/com/rackspacecloud/android/ListContainerActivity.java

b/src/com/rackspacecloud/android/ListContainerActivity.java
41 41
	public int kbConver = 1024;
42 42
	protected static final int DELETE_ID = 0;
43 43
	private Context context;
44
	private boolean loading;
44 45
	
45 46
	@Override
46 47
	public void onCreate(Bundle savedInstanceState) {
......
53 54
	protected void onSaveInstanceState(Bundle outState) {
54 55
		super.onSaveInstanceState(outState);
55 56
		outState.putSerializable("container", containers);
57
		outState.putBoolean("loading", loading);
56 58
	}
57 59

  
58 60
	private void restoreState(Bundle state) {
59
		if (state != null && state.containsKey("container")) {
61
		loading = state!= null && state.containsKey("loading") && state.getBoolean("loading");
62
		if (state != null && state.containsKey("container") && !loading) {
60 63
			containers = (Container[]) state.getSerializable("container");
61 64
			if (containers.length == 0) {
62 65
				displayNoServersCell();
......
75 78
			Intent viewIntent = new Intent(this, ContainerObjectsActivity.class);
76 79
			viewIntent.putExtra("container", containers[position]);
77 80
			startActivityForResult(viewIntent, 55);
78

  
79
			// startActivityForResult(viewIntent, 55); // arbitrary number;
80
			// never used again
81 81
		}
82 82
	}
83 83

  
......
142 142
		private CloudServersException exception;
143 143

  
144 144
		@Override
145
		protected void onPreExecute(){
146
			loading = true;
147
		}
148
			
149
		@Override
145 150
		protected ArrayList<Container> doInBackground(Void... arg0) {
146 151
			ArrayList<Container> containers = null;
147 152

  
......
168 173
					containerNames[i] = container.getName();
169 174
				}
170 175
			}
171

  
176
			loading = false;
172 177
			new LoadCDNContainersTask().execute((Void[]) null);
173 178
		}
174 179
	}
......
179 184
		private CloudServersException exception;
180 185

  
181 186
		@Override
187
		protected void onPreExecute(){
188
			loading = true;
189
		}
190
		
191
		@Override
182 192
		protected ArrayList<Container> doInBackground(Void... arg0) {
183 193
			ArrayList<Container> cdnContainers = null;
184 194

  
......
211 221
				}
212 222
			}
213 223
			setContainerList();
224
			loading = false;
214 225
		}
215 226
	}
216 227

  

Also available in: Unified diff