findViewById
is a method of Activity, so in this line
View layout = inflater.inflate(R.layout.custom_toast,(ViewGroup) findViewById(R.id.custom_toast_layout));
you need context.findViewById(R.id.custom_toast_layout)
That's the reason for that compile time error.