Revision a597c658 src/com/rackspacecloud/android/ViewServerActivity.java
b/src/com/rackspacecloud/android/ViewServerActivity.java | ||
---|---|---|
22 | 22 |
import android.app.Activity; |
23 | 23 |
import android.app.AlertDialog; |
24 | 24 |
import android.app.Dialog; |
25 |
import android.content.Context; |
|
25 | 26 |
import android.content.DialogInterface; |
26 | 27 |
import android.graphics.Color; |
27 | 28 |
import android.os.AsyncTask; |
... | ... | |
51 | 52 |
private String[] flavorNames; |
52 | 53 |
private String selectedFlavorId; |
53 | 54 |
private boolean imageLoaded; |
55 |
Context context; |
|
54 | 56 |
|
55 | 57 |
/** Called when the activity is first created. */ |
56 | 58 |
@Override |
57 | 59 |
public void onCreate(Bundle savedInstanceState) { |
58 | 60 |
super.onCreate(savedInstanceState); |
59 | 61 |
server = (Server) this.getIntent().getExtras().get("server"); |
62 |
context = getApplicationContext(); |
|
60 | 63 |
setContentView(R.layout.viewserver); |
61 | 64 |
restoreState(savedInstanceState); |
62 | 65 |
} |
... | ... | |
333 | 336 |
@Override |
334 | 337 |
protected Server doInBackground(Void... arg0) { |
335 | 338 |
try { |
336 |
server = (new ServerManager()).find(Integer.parseInt(server.getId())); |
|
339 |
server = (new ServerManager()).find(Integer.parseInt(server.getId()), context);
|
|
337 | 340 |
} catch (NumberFormatException e) { |
338 | 341 |
// we're polling, so need to show exceptions |
339 | 342 |
} catch (CloudServersException e) { |
... | ... | |
358 | 361 |
protected HttpResponse doInBackground(Void... arg0) { |
359 | 362 |
HttpResponse resp = null; |
360 | 363 |
try { |
361 |
resp = (new ServerManager()).reboot(server, ServerManager.SOFT_REBOOT); |
|
364 |
resp = (new ServerManager()).reboot(server, ServerManager.SOFT_REBOOT, context);
|
|
362 | 365 |
} catch (CloudServersException e) { |
363 | 366 |
exception = e; |
364 | 367 |
} |
... | ... | |
393 | 396 |
protected HttpResponse doInBackground(Void... arg0) { |
394 | 397 |
HttpResponse resp = null; |
395 | 398 |
try { |
396 |
resp = (new ServerManager()).reboot(server, ServerManager.HARD_REBOOT); |
|
399 |
resp = (new ServerManager()).reboot(server, ServerManager.HARD_REBOOT, context);
|
|
397 | 400 |
} catch (CloudServersException e) { |
398 | 401 |
exception = e; |
399 | 402 |
} |
... | ... | |
427 | 430 |
protected HttpResponse doInBackground(Void... arg0) { |
428 | 431 |
HttpResponse resp = null; |
429 | 432 |
try { |
430 |
resp = (new ServerManager()).resize(server, Integer.parseInt(selectedFlavorId)); |
|
433 |
resp = (new ServerManager()).resize(server, Integer.parseInt(selectedFlavorId), context);
|
|
431 | 434 |
} catch (CloudServersException e) { |
432 | 435 |
exception = e; |
433 | 436 |
} |
... | ... | |
464 | 467 |
protected HttpResponse doInBackground(Void... arg0) { |
465 | 468 |
HttpResponse resp = null; |
466 | 469 |
try { |
467 |
resp = (new ServerManager()).delete(server); |
|
470 |
resp = (new ServerManager()).delete(server, context);
|
|
468 | 471 |
} catch (CloudServersException e) { |
469 | 472 |
exception = e; |
470 | 473 |
} |
Also available in: Unified diff