Code example for Dialog

Methods: cancel

0
                    @Override 
                    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                        // Add empty application definition, the user will be able to edit it later 
                        PackageItem info = (PackageItem) parent.getItemAtPosition(position);
                        addCustomApplicationPref(info.packageName);
                        dialog.cancel();
                    } 
                }); 
                break; 
            default: 
                dialog = null;
        } 
        return dialog;
    } 
 
    /** 
     * Application class 
     */ 
    private static class Package { 
        public String name;
        public Integer color;