此文版权属于作者所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!
class YouClass extends View { @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); info.setClassName(YouClass.class.getName()); mProvider.getViewDelegate().onInitializeAccessibilityNodeInfo(info); } @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); event.setClassName(YouClass.class.getName()); } }
在 android monitor View Hierarchy 的 View 树上显示你的类名
原文地址:http://blog.csdn.net/lzy0168/article/details/42645167