java - 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.
What is grey code mean? What should i do?
解决方案
格雷码通常意味着那些代码行是多余的。你可以用 lambda 替换它们。
比如不写,
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
...
}
});
你可以写,
button.setOnClickListener(view -> {
...
});
推荐阅读
- react-native - 使用异步 componentDidMount() 预期的 React Native 导入字体 =>
- javascript - 当我尝试在 JavaScript 函数中使用它时,Java JSP 代码不会增加
- reactjs - 将数组从 Laravel 传递到 React 时 JSON 输入意外结束
- c# - 如何修复,输入字符串格式不正确,统一 3d 和串行
- java - 有没有更简单的方法来定义对象中的对象?
- python - 短标量中的 Numpy 溢出
- mysql - 如何在 MySql 中对 IP 地址进行排序,所以 ipv4 排在 ipv6 地址之前?
- python - 如何从声音文件中获取幅度和频率?
- macos - VS Code 不会在 mac 上的任何断点处停止
- google-cloud-platform - 如何在 AI Platform 上的自定义 Docker 映像中挂载 GCS 存储桶?