private LayoutInflater inflater;
is just declared not initialized
You need to pass the context to the constructor of adapter class and then use it to initialize inflater.
new Yourcustomadapter(ActivityName.this);
// pass the context here and other params
Then
private LayoutInflater inflater;
public Yourcustomadapterr(Context context)
{
inflater = LayoutInflater.from(context);
}
Also check this
http://developer.android.com/reference/android/view/View.html#getContext()