Fragments
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//inflater provided
View view;
...
return view;
}
BaseAdapter:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//have to make a constructor to get an inflater
....
return view;
}
Why does BaseAdapter
's getView()
method parameters doesnt provide an LayoutInflater
unlike Fragment
's onCreateView()
? Wherein in this method we are expected to inflate views?
Inflating views requires that we have a reference to an LayoutInflater
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…