calling LoaderManager in onItemSelectedListener in AdapterView inside Fragment in Android : please i'm trying to initiate LoaderManager on spinner item selected in FragmentActivity but have been getting error, i call the same loaderManager passing this as context outside onItemSelectedListener and it worked perfectly but unable to call it inside onItemSelectedListener. please kindly help

    cryptoSpinners.setOnItemSelectedListener (new OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) {
                selected = adapterView.getItemAtPosition(position).toString();

                LoaderManager loaderManager = getLoaderManager();
                loaderManager.restartLoader(EARTHQUAKE_LOADER_ID, null, getActivity());
            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {

            }
        });