问题
I am following the tutorial given here http://www.android-feedback.com/library for sending feedback. But I am unable to show dialog in onOptionsItemSelected
.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//menu.add("Email");
// TODO Auto-generated method stub
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case 0:
// do whatever
FeedbackSettings feedbackSettings = new FeedbackSettings();
//SUBMIT-CANCEL BUTTONS
feedbackSettings.setCancelButtonText("No");
feedbackSettings.setSendButtonText("Send");
//DIALOG TEXT
feedbackSettings.setText("Hey, would you like to give us some feedback so that we can improve your experience?");
feedbackSettings.setYourComments("Type your question here...");
feedbackSettings.setTitle("Feedback Dialog Title");
//TOAST MESSAGE
feedbackSettings.setToast("Thank you so much!");
feedbackSettings.setToastDuration(Toast.LENGTH_SHORT); // Default
feedbackSettings.setToastDuration(Toast.LENGTH_LONG);
//RADIO BUTTONS
feedbackSettings.setRadioButtons(false); // Disables radio buttons
feedbackSettings.setBugLabel("Bug");
feedbackSettings.setIdeaLabel("Idea");
feedbackSettings.setQuestionLabel("Question");
//RADIO BUTTONS ORIENTATION AND GRAVITY
feedbackSettings.setOrientation(LinearLayout.HORIZONTAL); // Default
feedbackSettings.setOrientation(LinearLayout.VERTICAL);
feedbackSettings.setGravity(Gravity.RIGHT); // Default
feedbackSettings.setGravity(Gravity.LEFT);
feedbackSettings.setGravity(Gravity.CENTER);
//SET DIALOG MODAL
feedbackSettings.setModal(true); //Default is false
//DEVELOPER REPLIES
feedbackSettings.setReplyTitle("Message from the Developer");
feedbackSettings.setReplyCloseButtonText("Close");
feedbackSettings.setReplyRateButtonText("RATE!");
//DEVELOPER CUSTOM MESSAGE (NOT SEEN BY THE END USER)
feedbackSettings.setDeveloperMessage("This is a custom message that will only be seen by the developer!");
feedBack = new FeedbackDialog(this, "AF-548BD4EFE07D-89", feedbackSettings);
feedBack.show();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
I am unable to show the dialog on click of item !
Please help me to identify my mistake !
Thanks in advance !
来源:https://stackoverflow.com/questions/26001170/show-dialog-of-android-feedback-com-library