Skip to content

Commit 5ddb345

Browse files
committed
Replaced throwing with showing message
1 parent d25b79e commit 5ddb345

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: wear-socket/src/main/java/com/github/jrejaud/wear_socket/WearSocket.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,13 @@ public void onConnectionSuspended(int i) {
8585
})
8686
.addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
8787
@Override
88-
public void onConnectionFailed(ConnectionResult result) {
89-
throw new RuntimeException(result.toString());
88+
public void onConnectionFailed(final ConnectionResult result) {
89+
((Activity)context).runOnUiThread(new Runnable() {
90+
@Override
91+
public void run() {
92+
Toast.makeText(context,"Connection Failed: "+result.getErrorMessage(),Toast.LENGTH_SHORT).show();
93+
}
94+
});
9095
}
9196
})
9297
.addApi(Wearable.API)

0 commit comments

Comments
 (0)