I have just come across the getLayoutInflater() method, I have always used
LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); to get the layout inflater so I was just wondering what is the difference between these two? Is there a case where one of these will work and not the other ? Thanks
Best way to get layout inflater?
204 Views Asked by Amr El Aswar At
1
For an
Activity, both of those should give you the sameLayoutInflater, but I would assumegetLayoutInflater()is better because it simply grabs theLayoutInflaterthat is already cached in theWindowgiven to theActivity.