我按照此处提供的教程http://www.android-feedback.com/library发送反馈。但我无法在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);
}
}
我无法在点击项目时显示对话框!
请帮我辨别我的错误!
提前致谢!