I moved the report filing work, to it's own thread

closes #96

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-06-03 11:52:49 -04:00
parent 9b7c2594c9
commit 824f58879c

View File

@@ -191,18 +191,23 @@ public class ReportPostingService extends Service {
*/ */
private void postReport(){ private void postReport(){
if(!isStarted){ if(!isStarted){
isStarted = true; new Thread(new Runnable(){
try { @Override
Log.d(TAG, mReport.file()); public void run(){
} catch (ClientProtocolException e) { isStarted = true;
e.printStackTrace(); try {
hasErrored = true; Log.d(TAG, mReport.file());
} catch (IOException e) { } catch (ClientProtocolException e) {
e.printStackTrace(); e.printStackTrace();
hasErrored = true; hasErrored = true;
} finally { } catch (IOException e) {
ReportPostingService.this.stopSelf(mStartId); e.printStackTrace();
} hasErrored = true;
} finally {
ReportPostingService.this.stopSelf(mStartId);
}
}
}).start();
} }
} }
} }