Skip to content

Instantly share code, notes, and snippets.

@willwhitney
Last active December 20, 2015 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willwhitney/6168372 to your computer and use it in GitHub Desktop.
Save willwhitney/6168372 to your computer and use it in GitHub Desktop.
A snippet demonstrating how to add Audobox Feedback to your app's menu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(
Menu.NONE, // Not part of a group
1990, // ID for the menu item (arbitrary, must match the case below)
Menu.NONE, // Order (set higher than other items to be lower in menu)
"Send feedback"); // Title for the menu item
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case 1990:
Audobox.createFeedbackDialog(this)
.withTitle("Feedback for My App")
.withColor(R.color.aqua)
.withApiKey("your_api_key") // your Audobox API key
.forUser("user_email@example.com") // whatever identifying info about your user
// you want to see in the dash
.show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment