Java tutorial
//package com.java2s; import android.content.Context; import android.support.annotation.LayoutRes; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class Main { public static View infalte(Context context, @LayoutRes int layoutId, ViewGroup parent) { return LayoutInflater.from(context).inflate(layoutId, parent, false); } }