我不明白这里的0有什么用。 它到底在做什么?
public WordAdapter(Activity nmbersActivity, ArrayList<Word> word) {
super(nmbersActivity,0,word);
}
我检查了文档,但找不到它到底是什么。
在实现中,这是代码。
public ArrayAdapter(@NonNull Context context, @LayoutRes int resource,
@NonNull List<T> objects) {
this(context, resource, 0, objects);
}
最佳答案
来自docs :
The id of the TextView within the layout resource to be populated
ArrayAdapters 通常用在列表中,因此包含文本资源 ID 来显示项目标题。传递 0 表示没有 TextView 资源的默认状态。
关于java - 什么是资源:0 doing?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52685512/