Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9342fbbb authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Fix usage of getContext() on pre-M SDKs (1/2)

Bug: 25629359
Change-Id: I3a6c3413452d3f35aeea4011e15e420419ed0577
parent 461647fb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -90,6 +90,11 @@ public class ImportExportDialogFragment extends DialogFragment
        mExportMode = exportMode;
    }

    @Override
    public Context getContext() {
        return getActivity();
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.contacts.common.preference;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -68,5 +69,10 @@ public class DisplayOptionsPreferenceFragment extends PreferenceFragment {
                getString(R.string.pref_open_source_licenses_key));
        licensePreference.setIntent(new Intent(getActivity(), LicenseActivity.class));
    }

    @Override
    public Context getContext() {
        return getActivity();
    }
}