我有一个适配器,它可以扩展ArrayAdapter<T>
并想要注入它们LayoutInflater
。代码如下,但充气机总是null
public abstract class MyAdapter<T> extends ArrayAdapter<T> {
@Inject
protected LayoutInflater inflater;
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// inflater here is null
}
}