- public void onClick(DialogInterface dialog, int which) {
- new File(mLogFilename).delete();
- finish();
+ public void onClick(DialogInterface dialog, final int which) {
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ File file = new File(mLogFilename);
+ if (which == Dialog.BUTTON_POSITIVE) {
+ try {
+ HttpClient client = new HttpClient();
+ PostMethod post = new PostMethod(CRASHLOG_SUBMIT_URL);
+ Part[] parts = {new FilePart("crashfile", file)};
+ post.setRequestEntity(new MultipartRequestEntity(parts, post.getParams()));
+ client.executeMethod(post);
+ post.releaseConnection();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ file.delete();
+ finish();
+ }
+ }).start();