1. Home
  2. Docs
  3. Bugfender SDK for Android
  4. Collect user feedback

Collect user feedback

Getting feedback from the final users is one of the most important things for an app developer. Good user feedback allows you detect errors in your app and helps you to understand better your product:

var userFeedbackIntent = Bugfender.getUserFeedbackActivityIntent(
        context,
        "App bar title",
        "Give some instructions to your users",
        "Placeholder for subject textfield",
        "Placeholder for message textfield",
        "Send")
startActivityForResult (userFeedbackIntent, FeedbackActivity.REQUEST_CODE)

You can obtain information about the user action using the onActivityResult method:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == FeedbackActivity.REQUEST_CODE) {
        Toast.makeText (this, if(resultCode == Activity.RESULT_OK) "Feedback sent" else "Feedback cancelled", Toast.LENGTH_SHORT).show ()
    } else {
        super.onActivityResult (requestCode, resultCode, data)
    }
}

If you would like to show this Activity when the device is shaken, see here how to detect it.

If you already have the user feedback, for example, you already collected it with your own UI, you can send it like this:

Bugfender.sendUserFeedback("title", "message")