Code example for Fragment

Methods: getArguments, onSaveInstanceState

0
            mGenreAdapter.changeCursor(null);
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        outState.putAll(getArguments() != null ? getArguments() : new Bundle());
        super.onSaveInstanceState(outState);
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
        tracksBrowser(position, id);
    } 
 
    private void tracksBrowser(int index, long id) {
 
        String genreKey = mCursor.getString(mGenreNameIndex);
 
        Bundle bundle = new Bundle();
        bundle.putString(MIME_TYPE, Audio.Genres.CONTENT_TYPE);
        bundle.putString(GENRE_KEY, genreKey);