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:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user