|
1 | 1 | package fr.free.nrw.commons.contributions;
|
2 | 2 |
|
3 |
| -import android.app.Activity; |
4 | 3 | import android.content.Context;
|
5 | 4 | import android.database.Cursor;
|
6 | 5 | import android.support.v4.widget.CursorAdapter;
|
| 6 | +import android.view.LayoutInflater; |
7 | 7 | import android.view.View;
|
8 | 8 | import android.view.ViewGroup;
|
9 | 9 |
|
10 | 10 | import fr.free.nrw.commons.R;
|
11 | 11 |
|
12 | 12 | class ContributionsListAdapter extends CursorAdapter {
|
13 |
| - private Activity activity; |
14 | 13 |
|
15 |
| - public ContributionsListAdapter(Activity activity, Cursor c, int flags) { |
16 |
| - super(activity, c, flags); |
17 |
| - this.activity = activity; |
| 14 | + public ContributionsListAdapter(Context context, Cursor c, int flags) { |
| 15 | + super(context, c, flags); |
18 | 16 | }
|
19 | 17 |
|
20 | 18 | @Override
|
21 | 19 | public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {
|
22 |
| - View parent = activity.getLayoutInflater().inflate(R.layout.layout_contribution, viewGroup, false); |
| 20 | + View parent = LayoutInflater.from(context).inflate(R.layout.layout_contribution, viewGroup, false); |
23 | 21 | parent.setTag(new ContributionViewHolder(parent));
|
24 | 22 | return parent;
|
25 | 23 | }
|
|
0 commit comments