inflate是用来找layout下布局文件,并实例化;而findViewById是找布局文件下的具体widget。
示例:其中this是Activity实例对象
//使用inflate
LayoutInflater inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View mainView = inflater.inflate(R.layout.main_view);
//使用findViewById
TextView txtHello = (TextView)this.findViewById(R.id.txtHello);