--- android/PicturePoster/src/dk/thoerup/pictureposter/PostActivity.java 2010/02/20 12:44:43 595 +++ android/PicturePoster/src/dk/thoerup/pictureposter/PostActivity.java 2010/02/20 12:53:56 596 @@ -5,6 +5,7 @@ import java.util.ArrayList; import java.util.List; +import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; @@ -138,14 +139,21 @@ post.setEntity(entity); - + boolean ok = false; HttpClient client = new DefaultHttpClient(); try { - client.execute(post); - Toast.makeText(this, "Upload succeeded", Toast.LENGTH_LONG).show(); + HttpResponse resp = client.execute(post); + if (resp.getStatusLine().getStatusCode() == 200) { + ok = true; + } } catch (Exception e) { Log.d("PostActivity", "upload failed", e); + + } + if (ok == true) { + Toast.makeText(this, "Upload succeeded", Toast.LENGTH_LONG).show(); + } else { Toast.makeText(this, "Upload failed", Toast.LENGTH_LONG).show(); } }