Code example for HashSet

Methods: containsremove

0
 
    @Override 
    public void onListItemClick(ListView l, View v, int position, long id) {
        ServiceInfo info = mList.getItem(position);
        final ComponentName cn = new ComponentName(info.packageName, info.name);
        if (mEnabledListeners.contains(cn)) {
            // the simple version: disabling 
            mEnabledListeners.remove(cn);
            saveEnabledListeners(); 
        } else { 
            // show a scary dialog 
            new ListenerWarningDialogFragment() 
                .setListenerInfo(cn, info.loadLabel(mPM).toString())
                .show(getFragmentManager(), "dialog");
        } 
    } 
 
    static class ViewHolder { 
        ImageView icon;
        TextView name;
Stop searching for code, let great code find you!  Add Codota to your java IDE