断点不在Handler内部工作 - Android Studio

时间:2017-07-26 07:58:11

标签: android-studio

我班上的所有其他断点都运行得很好。 但是,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);

                }
            });


        }
    };

0 个答案:

没有答案