这两者有什么区别吗?
> inflater =(LayoutInflater)LayoutInflater.from(context);
> inflater =(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
最佳答案
目前还没有,正如你可以通过检查the
LayoutInflater
source code看到的那样.来自()将抛出异常而不是返回null,但是否则它们是相同的.
就个人而言,我大多数时候都使用getLayoutInflater().