Code example for PreferenceGroup

Methods: addPreference

    void createDevicePreference(CachedBluetoothDevice cachedDevice) {
        BluetoothDevicePreference preference = new BluetoothDevicePreference(
                getActivity(), cachedDevice);
        mDevicePreferenceMap.put(cachedDevice, preference);
     * Overridden in {@link BluetoothSettings} to add a listener. 
     * @param preference the newly added preference 
    void initDevicePreference(BluetoothDevicePreference preference) {
        // Does nothing by default 
    public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {
        BluetoothDevicePreference preference = mDevicePreferenceMap.remove(cachedDevice);
        if (preference != null) {
Stop searching for code, let great code find you!  Add Codota to your java IDE