LayoutInflater layoutInflater = getLayoutInflater();
LayoutInflater layoutInflater2 = LayoutInflater.from(this);
LayoutInflater layoutInflater3 = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
public LayoutInflater getLayoutInflater() {
return getWindow().getLayoutInflater();
}
public static LayoutInflater from(Context context) {
LayoutInflater LayoutInflater =
(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (LayoutInflater == null) {
throw new AssertionError("LayoutInflater not found.");
}
return LayoutInflater;
}
public View inflate (int resource, ViewGroup root)
public View inflate (XmlPullParser parser, ViewGroup root)
public View inflate (XmlPullParser parser, ViewGroup root, boolean attachToRoot)
public View inflate (int resource, ViewGroup root, boolean attachToRoot)
LayoutInflater layoutInflater = getLayoutInflater();
View view = layoutInflater.inflate(R.layout.item, null);
TextView text = (TextView) view.findViewById(R.id.inflate_txt);
text.setText("http://www.cnblogs.com/xiaofeixiang");
text.setTextSize(18);
text.setTextColor(Color.RED);
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setView(view);
AlertDialog alertDialog = builder.create();
alertDialog.show();