相关疑难解决方法(0)

在Eclipse和Android应用程序中调试时,无法在匿名类中看到最终变量内容

在调试(eclipse)中,我无法在变量视图中看到变量内容,也无法在Expressions视图中或在Display视图中看到 - 如果变量是在匿名类之外定义但调试在匿名类中.

当我尝试在调试中看到内容时,我得到错误:x无法解析为变量.

在以下示例中,无法解析x:

private void someMethod(final Object x) {
  new Runnable() {
    public void run() {
      Log.i(x); // x is printed correctly but cannot be resolved when in Debug
    }
  }.run();
}
Run Code Online (Sandbox Code Playgroud)

这个问题关于eclipse开发环境 - 关于调试Android.这不是关于final,也不是编译的讨论 - 只是调试.

eclipse variables debugging android final

12
推荐指数
1
解决办法
1395
查看次数

标签 统计

android ×1

debugging ×1

eclipse ×1

final ×1

variables ×1