【问题标题】:Log.i Log.d ecc Not working on Android StudioLog.i Log.d ecc 不适用于 Android Studio
【发布时间】:2017-05-31 17:51:36
【问题描述】:

我不知道为什么,但是当我尝试使用 Log 时,在我的 Android Studio 代码中。它不会显示在 Android Monitor 上。我选择了所有选项:没有过滤器并选择了我的手机。 有代码示例:

JSONObject req = new JSONObject();
try {
    req.put("username", username_login.getText().toString());
    req.put("password", password_login.getText().toString());
    req.put("path", "login");
    Log.i("request", username_login.getText() + " " + password_login.getText().toString() + " " + password_login.getText().toString().length());

    new Request(new RequestCallback() {
        @Override
        public void in_the_end(JSONObject a) {
           }}}



        }
    }).execute(req);

【问题讨论】:

  • 可能这个请求没有被执行。请显示minimal reproducible example
  • 如果我使用 Toast 方法有效并且此代码 100% 有效
  • 尝试在命令行中使用adb logcat

标签: android logging logcat


【解决方案1】:

似乎你没有正确过滤它会正常工作

更改 Log cat 中的设置,如 image 中所述

【讨论】:

  • 除非应该有一个可调试的应用程序
【解决方案2】:

尝试更改已连接的安卓手机。如果能正常工作,说明你的开发者选项设置有问题。

【讨论】:

    猜你喜欢
    • 2011-12-19
    • 2017-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多