Code example for WeakHashMap

Methods: remove

0
    void initDevicePreference(BluetoothDevicePreference preference) {
        // Does nothing by default 
    } 
 
    public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {
        BluetoothDevicePreference preference = mDevicePreferenceMap.remove(cachedDevice);
        if (preference != null) {
            mDeviceListGroup.removePreference(preference);
        } 
    } 
 
    public void onScanningStateChanged(boolean started) {
        updateProgressUi(started);
    } 
 
    private void updateProgressUi(boolean start) {
        if (mDeviceListGroup instanceof BluetoothProgressCategory) {
            ((BluetoothProgressCategory) mDeviceListGroup).setProgress(start);
        } 
    }