Set Up User Feedback

Learn how to enable User Feedback in your Android app.

The User Feedback feature allows you to collect user feedback from anywhere inside your application at any time, without needing an error event to occur first.

The widget is a custom button that opens the feedback form. You can use it directly in your layout XML or instantiate it programmatically:

myLayout.xml
Copied
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
>

    <io.sentry.android.core.SentryUserFeedbackButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
  />
</LinearLayout>

The User Feedback form allows users to submit feedback from anywhere inside your application. For the configuration options, please refer to the User Feedback Widget Configuration.

Copied
import io.sentry.android.core.SentryUserFeedbackDialog;

// Just instantiate the dialog and show it whenever you want
new SentryUserFeedbackDialog.Builder(context).create().show();

The User Feedback widget integrates seamlessly with Session Replay. When the widget is opened, the SDK buffers up to 30 seconds of the user's session. If feedback is submitted, this replay is sent along with the feedback, allowing you to view both the feedback and the user's actions leading up to the feedback submission.

The User Feedback API allows you to collect user feedback while using your own UI components. You can submit feedback directly using the Sentry.captureFeedback(Feedback) method:

Copied
import io.sentry.Sentry;
import io.sentry.protocol.Feedback;

Feedback feedback = new Feedback("I encountered a bug while using the app.");
feedback.setName("John Doe");
feedback.setContactEmail("john.doe@example.com");
// Optionally associate the feedback with an event
SentryId sentryId = Sentry.captureMessage("My message");
feedback.setAssociatedEventId(sentryId);
Sentry.captureFeedback(feedback);
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").