首页 > 解决方案 > i see grey code in android studio. What is grey code mean?

问题描述

I'm try to learning how can ı use api for android studio. I found document on google but it's not working or i making something wrong. I copied that code from "https://developer.android.com/training/volley/request". But when i pasted code and imported "com.android.volley.Response;" , i see grey lines on my code like a comment line.

grey codes.

What is grey code mean? What should i do?

标签: javaandroid-studioandroid-volley

解决方案


格雷码通常意味着那些代码行是多余的。你可以用 lambda 替换它们。

比如不写,

button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        ...
    }
});

你可以写,

button.setOnClickListener(view -> {
    ...
});

推荐阅读