Your inflater cannot be resolved ? It means you have not initialized or even declared the variable in your code, the code you copied from the other question said "do other initialization", that was one of them that was not showed. You can do so like this :
LayoutInflater inflater = (LayoutInflater)context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);