Java tutorial
//package com.java2s; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class Main { public static View inflate(int layout, ViewGroup root, Context context) { LayoutInflater i = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); return i.inflate(layout, root); } }