Use ContextCompat.getSystemService() and the Context.getSystemService() extension function.

This commit is contained in:
Isira Seneviratne 2020-09-13 17:20:29 +05:30
parent cdb6e718f7
commit 3da55d9f40
17 changed files with 61 additions and 43 deletions

View file

@ -29,6 +29,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.DiffUtil;
@ -120,7 +121,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
mContext = context;
mDownloadManager = downloadManager;
mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = ContextCompat.getSystemService(mContext, LayoutInflater.class);
mLayout = R.layout.mission_item;
mHandler = new Handler(context.getMainLooper());