Example usage for android.content Context LAYOUT_INFLATER_SERVICE

List of usage examples for android.content Context LAYOUT_INFLATER_SERVICE

Introduction

In this page you can find the example usage for android.content Context LAYOUT_INFLATER_SERVICE.

Prototype

String LAYOUT_INFLATER_SERVICE

To view the source code for android.content Context LAYOUT_INFLATER_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.view.LayoutInflater for inflating layout resources in this context.

Usage

From source file:Main.java

public static View getView(Context context, int layoutId) {
    View v = ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(layoutId,
            null);/*w  w w  .jav  a2 s  . c o  m*/
    return v;
}

From source file:Main.java

public static LayoutInflater getLayoutInflater(Context context) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    return inflater;
}

From source file:Main.java

public static View inflate(int layout, ViewGroup root, Context context) {
    LayoutInflater i = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    return i.inflate(layout, root);
}

From source file:Main.java

public static View initView(Context context, int notificationItem, ViewGroup root) {
    return ((LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
            .inflate(notificationItem, root);
}

From source file:Main.java

public static View addListViewHeaderView(ListView listview, int layoutId, Context context) {
    LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = mInflater.inflate(layoutId, null);
    listview.addHeaderView(view);/*from w  w w.j  av  a2 s.com*/
    return view;
}

From source file:Main.java

public static LayoutInflater getLayoutInflater(Context c) {
    return (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}

From source file:MainActivity.java

public void showToast(View view) {
    LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = inflater.inflate(R.layout.toast_custom, null);
    ((TextView) layout.findViewById(android.R.id.message)).setText("Custom Toast");
    Toast toast = new Toast(this);
    toast.setGravity(Gravity.CENTER, 0, 0);
    toast.setDuration(Toast.LENGTH_LONG);
    toast.setView(layout);/*from ww  w .jav a 2  s .  c  om*/
    toast.show();
}

From source file:com.irontec.adapters.SimpleLicenseAdapter.java

public SimpleLicenseAdapter(Context context, ArrayList<BasicNameValuePair> values) {
    this.mContext = context;
    this.mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    this.mValues = values;
}

From source file:com.droidsans.photo.droidphoto.AboutFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    rootView = inflater.inflate(R.layout.fragment_about, container, false);
    mainList = (ListView) rootView.findViewById(R.id.about_list);

    mainList.addHeaderView(//from w w  w.j av  a 2 s.  co m
            ((LayoutInflater) getActivity().getApplication().getSystemService(Context.LAYOUT_INFLATER_SERVICE))
                    .inflate(R.layout.item_about_header, null, false));
    mainList.setAdapter(new ArrayAdapter<>(getActivity(), R.layout.item_text,
            getResources().getStringArray(R.array.about_list)));
    //        mainList.setAdapter();

    return rootView;
}

From source file:at.wada811.android.library.demos.app.TabViewPagerAdapter.java

public TabViewPagerAdapter(Context context) {
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}