get LayoutInflater from Context - Android User Interface

Android examples for User Interface:Layout Inflater

Description

get LayoutInflater from Context

Demo Code


//package com.java2s;
import android.content.Context;
import android.view.LayoutInflater;

public class Main {
    public static LayoutInflater getInflater(Context context) {
        return (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }/*from  w w  w .  j  a  v a2 s  .  c  o  m*/
}

Related Tutorials