Skip to content

Use Context instead of Activity for layout inflation #773

@WillieCubed

Description

@WillieCubed

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions