There is a way to get layoutInflater:
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
and another way is:
LayoutInflater inflater = LayoutInflater.from(context);
a third one (when I am in an Activity) is:
LayoutInflater inflater = getLayoutInflater();
So what is the difference between them?
Note that when I sent the third inflater to my adapter, my application worked. But when I sent the context and created the inflater via the second way, it didn't!