From 824f58879c73a39e2594418135932297a16f1bd8 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sun, 3 Jun 2012 11:52:49 -0400 Subject: [PATCH] I moved the report filing work, to it's own thread closes #96 Signed-off-by: Ricky Barrette --- .../exception/ReportPostingService.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java b/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java index a615ed0..b4f08be 100644 --- a/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java +++ b/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java @@ -191,18 +191,23 @@ public class ReportPostingService extends Service { */ private void postReport(){ if(!isStarted){ - isStarted = true; - try { - Log.d(TAG, mReport.file()); - } catch (ClientProtocolException e) { - e.printStackTrace(); - hasErrored = true; - } catch (IOException e) { - e.printStackTrace(); - hasErrored = true; - } finally { - ReportPostingService.this.stopSelf(mStartId); - } + new Thread(new Runnable(){ + @Override + public void run(){ + isStarted = true; + try { + Log.d(TAG, mReport.file()); + } catch (ClientProtocolException e) { + e.printStackTrace(); + hasErrored = true; + } catch (IOException e) { + e.printStackTrace(); + hasErrored = true; + } finally { + ReportPostingService.this.stopSelf(mStartId); + } + } + }).start(); } } -} +} \ No newline at end of file