简体   繁体   English

如何在视图中添加字符串属性以供Viewserver转储

[英]how to add a string property in view for viewserver to dump

I'm trying to add a string property in Android View.java and make ViewServer could dump view and get it. 我正在尝试在Android View.java中添加字符串属性,并使ViewServer可以转储视图并获取它。

Here is what I wrote, but it doesn't work. 这是我写的,但是没有用。

protected String mTestinfo = "myTestInfo";
/** {@hide} */
@ViewDebug.ExportedProperty
public String getTestinfo(){
    return mTestinfo;
}

Could anyone help on this? 有人可以帮忙吗?

Have you tried changing it to: 您是否尝试过将其更改为:

public String getTestinfo(){
    return mTestinfo;
}

with a capital 'S'? 大写的“ S”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM