Code example for Fragment

Methods: getArgumentsonSaveInstanceState

1
            mPlaylistAdapter.changeCursor(null);
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        outState.putAll(getArguments() != null ? getArguments() : new Bundle());
        super.onSaveInstanceState(outState);
    } 
 
    @Override 
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
 
        AdapterContextMenuInfo mi = (AdapterContextMenuInfo)menuInfo;
 
        menu.add(0, PLAY_SELECTION, 0, getResources().getString(R.string.play_all));
 
        if (mi.id >= 0) {
            menu.add(0, RENAME_PLAYLIST, 0, getResources().getString(R.string.rename_playlist));
            menu.add(0, DELETE_PLAYLIST, 0, getResources().getString(R.string.delete_playlist));
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE