i see grey code in android studio. What is grey code mean?

Viewed 385

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?

1 Answers

Grey codes usually mean that those code lines are redundant. You could have replaced them with lambda.

For example without writing,

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

you can write,

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