Revision d88d3ae1 src/com/rackspacecloud/android/BackupServerActivity.java
b/src/com/rackspacecloud/android/BackupServerActivity.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import android.app.Activity; |
25 | 25 |
import android.app.AlertDialog; |
26 |
import android.content.Context; |
|
26 | 27 |
import android.content.DialogInterface; |
27 | 28 |
|
28 | 29 |
import android.os.AsyncTask; |
... | ... | |
112 | 113 |
alert.show(); |
113 | 114 |
} |
114 | 115 |
|
116 |
private void showToast(String message) { |
|
117 |
Context context = getApplicationContext(); |
|
118 |
int duration = Toast.LENGTH_SHORT; |
|
119 |
Toast toast = Toast.makeText(context, message, duration); |
|
120 |
toast.show(); |
|
121 |
} |
|
122 |
|
|
115 | 123 |
private CloudServersException parseCloudServersException(HttpResponse response) { |
116 | 124 |
CloudServersException cse = new CloudServersException(); |
117 | 125 |
try { |
... | ... | |
147 | 155 |
private CloudServersException exception; |
148 | 156 |
|
149 | 157 |
@Override |
158 |
//let user know their process has started |
|
159 |
protected void onPreExecute(){ |
|
160 |
showToast("Changing backup schedule process has begun"); |
|
161 |
} |
|
162 |
|
|
163 |
@Override |
|
150 | 164 |
protected HttpResponse doInBackground(Void... arg0) { |
151 | 165 |
HttpResponse resp = null; |
152 | 166 |
try { |
... | ... | |
164 | 178 |
int statusCode = response.getStatusLine().getStatusCode(); |
165 | 179 |
Log.d("statuscode", Integer.toString(statusCode)); |
166 | 180 |
if(statusCode == 204 || statusCode == 202){ |
167 |
String mustMatch = "The server's backup schedule has been changed."; |
|
168 |
Toast passwordError = Toast.makeText(getApplicationContext(), mustMatch, Toast.LENGTH_SHORT); |
|
169 |
passwordError.show(); |
|
181 |
showToast("The server's backup schedule has been change."); |
|
170 | 182 |
finish(); |
171 | 183 |
} |
172 | 184 |
else if (statusCode != 204 && statusCode != 202) { |
Also available in: Unified diff