【问题标题】:What does the dollar sign at the end of a class mean in Eclipse MAT?Eclipse MAT 中课程末尾的美元符号是什么意思?
【发布时间】:2012-02-24 14:37:32
【问题描述】:

我正在使用 Eclipse MAT 来尝试追踪 Android 中的资源泄漏(如果您经常更改屏幕方向),当我转到直方图视图时,我看到我的活动与相同的活动一起列出来一次又一次后面有一个 $。

比如:

com.test.TestActivity
com.test.TestActivity$1
com.test.TestActivity$2
com.test.TestActivity$3

只是想知道 $1、$2 和 $3 是什么意思...

tia.

【问题讨论】:

标签: android eclipse memory-leaks


【解决方案1】:

它们是匿名的内部类。

例如:

Button button = (Button) findViewById(R.id.Button);  
button.setOnClickListener(new View.OnClickListener() {  
    public void onClick(View v) {  
        // ...
    }  
});

在这个例子中,匿名内部类是View.OnClickListener的子类。

【讨论】:

    猜你喜欢
    • 2020-01-20
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多