@Test public void testIgnoresNullBundle() { mTracker.onRestoreInstanceState(null); }
@Override public final void onRestoreInstanceState(@Nullable Bundle state) { if (state == null) { return; } @Nullable Bundle selectionState = state.getBundle(getInstanceStateKey()); if (selectionState == null) { return; } Selection<K> selection = mStorage.asSelection(selectionState); if (selection != null && !selection.isEmpty()) { restoreSelection(selection); } }
DefaultSelectionTracker extends SelectionTracker<K> { @Override public final void onRestoreInstanceState(@Nullable Bundle state) { if (state == null) { return; } @Nullable Bundle selectionState = state.getBundle(getInstanceStateKey()); if (selectionState == null) { return; } Selection<K> selection = mStorage.asSelection(selectionState); if (selection != null && !selection.isEmpty()) { restoreSelection(selection); } } }
DefaultSelectionTracker extends SelectionTracker<K> { @Override public final void onRestoreInstanceState(@Nullable Bundle state) { if (state == null) { return; } @Nullable Bundle selectionState = state.getBundle(getInstanceStateKey()); if (selectionState == null) { return; } Selection<K> selection = mStorage.asSelection(selectionState); if (selection != null && !selection.isEmpty()) { restoreSelection(selection); } } DefaultSelectionTracker(
            @NonNull String selectionId,
            @NonNull ItemKeyProvider keyProvider,
            @NonNull SelectionPredicate selectionPredicate,
            @NonNull StorageStrategy<K> storage); }
DefaultSelectionTracker extends SelectionTracker<K> { @Override public final void onRestoreInstanceState(@Nullable Bundle state) { if (state == null) { return; } @Nullable Bundle selectionState = state.getBundle(getInstanceStateKey()); if (selectionState == null) { return; } Selection<K> selection = mStorage.asSelection(selectionState); if (selection != null && !selection.isEmpty()) { restoreSelection(selection); } } DefaultSelectionTracker(
            @NonNull String selectionId,
            @NonNull ItemKeyProvider keyProvider,
            @NonNull SelectionPredicate selectionPredicate,
            @NonNull StorageStrategy<K> storage); @Override void addObserver(@NonNull SelectionObserver callback); @Override boolean hasSelection(); @Override Selection getSelection(); @Override void copySelection(@NonNull MutableSelection dest); @Override boolean isSelected(@Nullable K key); @Override boolean setItemsSelected(@NonNull Iterable<K> keys, boolean selected); @Override boolean clearSelection(); @Override boolean select(@NonNull K key); @Override boolean deselect(@NonNull K key); @Override void startRange(int position); @Override void extendRange(int position); @Override void endRange(); @Override void anchorRange(int position); @Override void extendProvisionalRange(int position); @Override void setProvisionalSelection(@NonNull Set<K> newSelection); @Override void mergeProvisionalSelection(); @Override void clearProvisionalSelection(); @Override boolean isRangeActive(); @Override @SuppressWarnings("unchecked") final void onSaveInstanceState(@NonNull Bundle state); @Override final void onRestoreInstanceState(@Nullable Bundle state); }
DefaultSelectionTracker extends SelectionTracker<K> { @Override public final void onRestoreInstanceState(@Nullable Bundle state) { if (state == null) { return; } @Nullable Bundle selectionState = state.getBundle(getInstanceStateKey()); if (selectionState == null) { return; } Selection<K> selection = mStorage.asSelection(selectionState); if (selection != null && !selection.isEmpty()) { restoreSelection(selection); } } DefaultSelectionTracker(
            @NonNull String selectionId,
            @NonNull ItemKeyProvider keyProvider,
            @NonNull SelectionPredicate selectionPredicate,
            @NonNull StorageStrategy<K> storage); @Override void addObserver(@NonNull SelectionObserver callback); @Override boolean hasSelection(); @Override Selection getSelection(); @Override void copySelection(@NonNull MutableSelection dest); @Override boolean isSelected(@Nullable K key); @Override boolean setItemsSelected(@NonNull Iterable<K> keys, boolean selected); @Override boolean clearSelection(); @Override boolean select(@NonNull K key); @Override boolean deselect(@NonNull K key); @Override void startRange(int position); @Override void extendRange(int position); @Override void endRange(); @Override void anchorRange(int position); @Override void extendProvisionalRange(int position); @Override void setProvisionalSelection(@NonNull Set<K> newSelection); @Override void mergeProvisionalSelection(); @Override void clearProvisionalSelection(); @Override boolean isRangeActive(); @Override @SuppressWarnings("unchecked") final void onSaveInstanceState(@NonNull Bundle state); @Override final void onRestoreInstanceState(@Nullable Bundle state);  }