我班上的所有其他断点都运行得很好。
但是,run
方法中没有任何断点。问题是什么?
private Emitter.Listener onConnect = new Emitter.Listener() {
@Override
public void call(final Object...args) {
new Handler(getMainLooper()).post(new Runnable() {
@Override
public void run() {
Toast.makeText(ChatService.this, "connected", Toast.LENGTH_SHORT).show();
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
String json = gson.toJson(user);
try {
obj = new JSONObject(json);
} catch (JSONException e) {
e.printStackTrace();
}
mSocket.emit("set-user-data", obj, user.getRole());
JSONArray membersJSONArray = new JSONArray();
membersJSONArray.put(user.getUsername());
JSONObject roomInfo = new JSONObject();
try {
roomInfo.put("members", membersJSONArray);
roomInfo.put("platformInfo", user.getPlatformInfo());
} catch (JSONException e) {
e.printStackTrace();
}
mSocket.emit("set-room", roomInfo);
}
});
}
};