android studio:缺少android支持库的代码完成源代码。例如,代码完成:
class MyListAdapter implements ListAdapter {
...
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
return null;
}
}
方法参数名称应为:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
对于android支持lib:android不会自动附加它们吗?如何手动附加它们?
Android Studio:3.4.1
答案 0 :(得分:0)
按下按钮
Ctrl + O
在框中,选择方法
类完整方法
public class MyListAdapter implements ListAdapter
{
@Nullable
@Override
public CharSequence[] getAutofillOptions() {
return new CharSequence[0];
}
@Override
public boolean areAllItemsEnabled() {
return false;
}
@Override
public boolean isEnabled(int position) {
return false;
}
@Override
public void registerDataSetObserver(DataSetObserver observer) {
}
@Override
public void unregisterDataSetObserver(DataSetObserver observer) {
}
@Override
public int getCount() {
return 0;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
@Override
public int getItemViewType(int position) {
return 0;
}
@Override
public int getViewTypeCount() {
return 0;
}
@Override
public boolean isEmpty() {
return false;
}
}