Reputation: 60184
Is there any difference between these two?
inflater = (LayoutInflater) LayoutInflater.from(context);
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
Upvotes: 5
Views: 303
Reputation: 1006614
Not at the present time, as you can see by examining the LayoutInflater
source code. from()
will throw an Exception
rather than returning null
, but otherwise they are identical.
Personally, I use getLayoutInflater()
most times.
Upvotes: 4