Java tutorial
//package com.java2s; import android.content.Context; import android.view.LayoutInflater; import android.view.View; public class Main { public static View getView(Context context, int layoutId) { View v = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(layoutId, null); return v; } }