No
As long as the Activity or Window that calls getLayoutInflater()
has the same Context that would call getSystemService()
, there is no difference.
Proof You can trace the LayoutInflater returned by getLayoutInflater()
to LayoutInflater.from() and you can see this is just a shortcut for getSystemService()
from the source code:
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;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…