Lor*_*ABA 32 android android-widget android-layout
简单的"不"回答会使我平静下来.如果有什么不同那么它是什么?
Sam*_*Sam 40
没有
只要调用的Activity或Window getLayoutInflater()具有可以调用的相同Context,就getSystemService()没有区别.
证明您可以跟踪返回的LayoutInflater getLayoutInflater()到LayoutInflater.from() ,你可以看到这只是一个快捷方式getSystemService()从源代码:
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;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19310 次 |
| 最近记录: |