You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm updating an addon library to this library, and it appears the FirebaseListAdapter is using an Activity parameter in the constructor where only a Context is needed. This would help out in situations where a home screen widget uses the adapter but doesn't have access to an Activity.
I say replacing it with a Context is a good idea because we only need it to inflate the layout, and the system already provides a more generalized way to access the layout inflater.
Instead of mActivity.getLayoutInflater().inflate(mLayout, viewGroup, false);
we should do this: LayoutInflater.from(mContext).inflate(mLayout, viewGroup, false); in the FirebaseListAdapter.
The text was updated successfully, but these errors were encountered:
WillieCubed
changed the title
Use
Use Context instead of Activity for layout inflation
Jun 22, 2017
I'm updating an addon library to this library, and it appears the
FirebaseListAdapter
is using anActivity
parameter in the constructor where only aContext
is needed. This would help out in situations where a home screen widget uses the adapter but doesn't have access to anActivity
.I say replacing it with a
Context
is a good idea because we only need it to inflate the layout, and the system already provides a more generalized way to access the layout inflater.Instead of
mActivity.getLayoutInflater().inflate(mLayout, viewGroup, false);
we should do this:
LayoutInflater.from(mContext).inflate(mLayout, viewGroup, false);
in theFirebaseListAdapter
.The text was updated successfully, but these errors were encountered: