Filterable thumbnail grid in Java for Android
Shows how to use PdfProcessor and DocumentCoordinator to create a page thumbnail grid that can be filtered to show either all, or only annotated or bookmarked pages. Get additional resources by visiting our guide on displaying a PDF in Android with PdfActivity.
/* * Copyright © 2020-2025 PSPDFKit GmbH. All rights reserved. * * The PSPDFKit Sample applications are licensed with a modified BSD license. * Please see License for details. This notice may not be removed from this file. */
package com.pspdfkit.catalog.examples.java;
import android.content.Context;import android.content.Intent;import androidx.annotation.NonNull;import com.pspdfkit.catalog.R;import com.pspdfkit.catalog.SdkExample;import com.pspdfkit.catalog.examples.java.activities.FilterableThumbnailGridActivity;import com.pspdfkit.configuration.activity.PdfActivityConfiguration;import com.pspdfkit.document.providers.AssetDataProvider;import com.pspdfkit.ui.PdfActivityIntentBuilder;
/** * Example on how to display filters in the thumbnail grid. Shows how to combine PDF processor and * customizability of the thumbnail grid to create filters. */public class FilterableThumbnailGridExample extends SdkExample {
public FilterableThumbnailGridExample(@NonNull Context context) { super( context.getString(R.string.filterableThumbnailGridExampleTitle), context.getString(R.string.filterableThumbnailGridExampleDescription)); }
@Override public void launchExample(@NonNull Context context, @NonNull PdfActivityConfiguration.Builder configuration) { final Intent intent = PdfActivityIntentBuilder.fromDataProvider(context, new AssetDataProvider(WELCOME_DOC)) .configuration(configuration.build()) .activityClass(FilterableThumbnailGridActivity.class) .build();
context.startActivity(intent); }}
This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.