If I want to reuse a Fragment inside my ArrayAdapter, is that inefficient?
That is, in my ArrayAdapter, my getView() would look like this:
public View getView(final int position, View convertView, ViewGroup parent) {
UserFragment userFragment = new UserFragment();
return userFragment.getView();
}
I ask, because normally in the getView() method, it looks something like this:
public View getView(final int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.user, null);
...//do stuff
}
Is it inefficient to create a Fragment each time the getView() is called?