如何在Android Studio中放置手表(请参阅如何修改变量)? [英] How to put a watch (see how a variable is modified) in Android Studio?

查看:192
本文介绍了如何在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?

推荐答案

首先在要查看特定变量的类中放置一个断点. 运行代码,一旦它从变量"窗口框架到达断点,您应该会看到所有可访问的变量.只需选择您要观看的手表,然后右键单击并从下拉菜单中选择添加到手表".

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.

进行调试,您将根据代码在适当的情况下从监视"窗口框架中看到变量.

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天全站免登陆