-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from ushahidi/420-dont-log-misleading-mesgs
Log messages for gained and lost data connectivity
- Loading branch information
Showing
1 changed file
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54951c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9ad1bb38-6fa8-41fe-ac0c-820141f62eso
54951c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mAlertPresenter.lostConnectionThread = new Thread(new Runnable() {
@OverRide
public void run() {
try {
Thread.sleep(AlertPresenter.MAX_DISCONNECT_TIME);
} catch (InterruptedException e) {
return;
}
mAlertPresenter.dataConnectionLost(); }
mAlertPresenter.dataConnectionLost();
}
});
Replace this with: mAlertPresenter.lostConnectionThread = new Thread(()->{
try {
Thread.sleep(AlertPresenter.MAX_DISCONNECT_TIME);
} catch (InterruptedException e) {
return;
}
mAlertPresenter.dataConnectionLost(); }
mAlertPresenter.dataConnectionLost();
});
?? Since Lambda expression is popular now.
And all Runnable interface can use lambda expression .