android - 如何在android studio中查看数组的内容

标签 android arrays android-studio debugging

我一直对 android studio 调试器显示数组数据的方式有疑问。它太困惑而且不直观。

我在将两个自定义对象添加到数组中时遇到问题,当我尝试呈现内容时其中一个变量被覆盖。

我想追踪可能发生的位置,但在 Debug模式下必须查看数组的内容绝对令人恐惧:

I have no clue of what is going on here

有没有办法将内容简化为几乎类似于 JSON 的状态?像这样:

Array:[
      {
        first object: {contents}
      },
      {
        secondobject: {contents}
      }
      ]

最佳答案

你可以使用 android studio Debug模式这样做:enter image description here

关于android - 如何在android studio中查看数组的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45217467/

相关文章:

android - 共享首选项 KEY_FIRST_RUN 在 android 1.6 中不起作用?

android - 为什么我不能在我的 Android 应用程序中创建 SQLite 数据库

java - 将 boolean 值转换为字符串

javascript - 如何根据td选择tr

带有卡片堆栈的 Android 垂直 View 寻呼机

c - 将二维字符数组传递给函数

java - 如何在java中向字符串数组的内容添加更多内容

android - 错误 : style attribute 'attr/colorPrimary' not found

android - "The name ' 页 ' is defined in the libraries ' 包 :burn_off/widgets/page. Dart ' and ' 包 :flutter/src/widgets/navigator. Dart '

java - 如何修复迭代期间添加项目时的 ConcurrentModificationException 错误