We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f083331 commit 37a32f8Copy full SHA for 37a32f8
wear-socket/src/main/java/com/github/jrejaud/wear_socket/WearSocket.java
@@ -103,8 +103,13 @@ public void run() {
103
String nodeID = findBestNodeId(nodes);
104
Log.d(TAG,"Node found: "+nodeID);
105
if (nodeID==null) {
106
- String message = "Error, cannot find a connected device";
107
- Toast.makeText(context,message,Toast.LENGTH_SHORT).show();
+ final String message = "Error, cannot find a connected device";
+ ((Activity)context).runOnUiThread(new Runnable() {
108
+ @Override
109
+ public void run() {
110
+ Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
111
+ }
112
+ });
113
new Throwable(message);
114
return;
115
}
0 commit comments