在 android 编程中,class 名称连接下划线是什么意思?
In android programming, what's the meaning of a class name concatenated an underscore?
public class VideoFragment extends Fragment implements CacheListener {
...
public static Fragment build(String url, String cachePath) {
return VideoFragment_.builder()
.url(url)
.cachePath(cachePath)
.build();
}
...
}
找了很多,还是不知道"VideoFragment_"?
有人能给我一些要点吗?
下划线在 Java 或 Android 中没有特殊含义。这只是名字的一部分。
您需要询问代码的原作者这样命名的意图是什么。
来自评论:
In fact, I'm studying this android project in github
这是与问题相关的信息。该项目正在使用 android-annotations enhanced fragments,其中:
AndroidAnnotations will generate a fragment subclass with a trailing underscore, e.g. MyFragment_
. You should use the generated subclass in your xml layouts and when creating new instance fragments
所以这是注释处理器的一个特性。
public class VideoFragment extends Fragment implements CacheListener {
...
public static Fragment build(String url, String cachePath) {
return VideoFragment_.builder()
.url(url)
.cachePath(cachePath)
.build();
}
...
}
找了很多,还是不知道"VideoFragment_"? 有人能给我一些要点吗?
下划线在 Java 或 Android 中没有特殊含义。这只是名字的一部分。
您需要询问代码的原作者这样命名的意图是什么。
来自评论:
In fact, I'm studying this android project in github
这是与问题相关的信息。该项目正在使用 android-annotations enhanced fragments,其中:
AndroidAnnotations will generate a fragment subclass with a trailing underscore, e.g.
MyFragment_
. You should use the generated subclass in your xml layouts and when creating new instance fragments
所以这是注释处理器的一个特性。