/** * Called when the loader finished loading its data. * * @param loader The used loader itself * @param model Data of the loader */ @Override public void onLoadFinished(Loader<List<ArtistModel>> loader, List<ArtistModel> model) { super.onLoadFinished(loader, model); // Reset old scroll position if (mLastPosition >= 0) { mRootGrid.setSelection(mLastPosition); mLastPosition = -1; } }
/** Called when the fragment is first attached to its context. */ @Override public void onAttach(Context context) { super.onAttach(context); // This makes sure that the container activity has implemented // the callback interface. If not, it throws an exception try { mArtistSelectedCallback = (OnArtistSelectedListener) context; } catch (ClassCastException e) { throw new ClassCastException(context.toString() + " must implement OnArtistSelectedListener"); } }
/** Create the context menu. */ @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.context_menu_artists_fragment, menu); }