Skip to content

Commit

Permalink
Replaced throwing with showing message
Browse files Browse the repository at this point in the history
  • Loading branch information
jrejaud committed Jun 23, 2016
1 parent d25b79e commit 5ddb345
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ public void onConnectionSuspended(int i) {
})
.addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(ConnectionResult result) {
throw new RuntimeException(result.toString());
public void onConnectionFailed(final ConnectionResult result) {
((Activity)context).runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(context,"Connection Failed: "+result.getErrorMessage(),Toast.LENGTH_SHORT).show();
}
});
}
})
.addApi(Wearable.API)
Expand Down

0 comments on commit 5ddb345

Please sign in to comment.