Java tutorial
//package com.java2s; import android.content.Context; import android.view.LayoutInflater; import android.view.View; public class Main { private static LayoutInflater inflater; public static View inflate(Context context, int res) { if (inflater == null) { inflater = LayoutInflater.from(context); } return inflater.inflate(res, null); } }