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(){
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();
}
}
}
}