File tree 1 file changed +5
-1
lines changed
wear-socket/src/main/java/com/github/jrejaud/wear_socket
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 5
5
import android .os .AsyncTask ;
6
6
import android .os .Bundle ;
7
7
import android .util .Log ;
8
+ import android .widget .Toast ;
8
9
9
10
import com .google .android .gms .common .ConnectionResult ;
10
11
import com .google .android .gms .common .api .GoogleApiClient ;
@@ -102,7 +103,9 @@ public void run() {
102
103
String nodeID = findBestNodeId (nodes );
103
104
Log .d (TAG ,"Node found: " +nodeID );
104
105
if (nodeID ==null ) {
105
- showErrorAndCloseApp ("Error, cannot find a connected device" ,true );
106
+ String message = "Error, cannot find a connected device" ;
107
+ Toast .makeText (context ,message ,Toast .LENGTH_SHORT ).show ();
108
+ new Throwable (message );
106
109
return ;
107
110
}
108
111
WearSocket .this .nodeID = nodeID ;
@@ -147,6 +150,7 @@ public void run() {
147
150
//*************************************************************************************
148
151
149
152
private void showErrorAndCloseApp (String message , boolean closeApp ) {
153
+ Toast .makeText (context ,message ,Toast .LENGTH_SHORT ).show ();
150
154
Log .e (TAG , message );
151
155
disconnect ();
152
156
if (closeApp ) {
You can’t perform that action at this time.
0 commit comments