如何把Android Studio中的手表(见一个变量是如何修改的)? [英] How to put a watch(see how a variable is modified) in Android Studio?

查看:256
本文介绍了如何把Android Studio中的手表(见一个变量是如何修改的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在Android的Studio中使用的手表。我希望看到一个变量的值是如何通过调试修改。有谁知道如何做到这一点?

I don't know how to use a watch in Android Studio. I want to see how the value of a variable modifies through debugging. Does anyone know how to do this?

推荐答案

通过把一个破发点在你想要观看特定变量的类开始。
运行code,一旦命中断点从变量窗框,你应该看到所有可访问的变量。只需选择你想要观看,然后右键单击之一,并选择添加到表,从下拉菜单。

Start by putting a break point in the class where you'd want to watch a specific variable. Run the code and once it hits your breakpoint from the Variables window frame you should see all of the variables that are accessible. Simply choose the one you'd want to watch and then right click and choose "Add to watches" from the drop-down.

请调试,你应该看到从手表窗框更新变量根据您的code在适当的时候。

Keep debugging and you should see the variable from the Watches window frame update when appropriate based on your code.

这篇关于如何把Android Studio中的手表(见一个变量是如何修改的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆