Android examples for User Interface:Layout
Creates a view via LayoutInflater.
//package com.java2s; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class Main { /**// w ww . j av a 2 s. c o m * Creates a view. * * @param parent parent view * @param resId resource id * @return view */ public static View newInstance(ViewGroup parent, int resId) { return LayoutInflater.from(parent.getContext()).inflate(resId, parent, false); } /** * Creates a view. * * @param context context * @param resId resource id * @return view */ public static View newInstance(Context context, int resId) { return LayoutInflater.from(context).inflate(resId, null); } }