问题与对话? [英] Issue with dialog?
本文介绍了问题与对话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下的code:
new AlertDialog.Builder(this)
.setTitle("WOW!")
.setMessage("AnotherMessage")
.setNegativeButton("Okay", null)
.setPositiveButton("SHARE!", new DialogInterface.OnMultiChoiceClickListener() {
public abstract void onClick (DialogInterface dialog, int which){
//Code to share
}
}).show();
我要两个都在我的警告对话框一个分享按钮与一个onclick听众,我会把在code分享。问题是,我收到错误:
I want two have a share button in my alert dialog with an onclick listener where I will put in the code to share. The problem is, I am getting the errors:
以下是错误:
我已经尝试了很多不同的东西,比如改变我的方法的参数,并把摘要
中的匿名内部类,但没有工作的话。
I have tried many different things, like changing my method parameters and putting the word abstract
in the anonymous inner class, but nothing worked.
我该如何解决这个问题?
How can I fix this?
推荐答案
您应该使用 DialogInterface.OnClickListener
接口而不是 DialogInterface.OnMultiChoiceClickListener 的code>。
You should use DialogInterface.OnClickListener
interface instead of DialogInterface.OnMultiChoiceClickListener
.
这篇关于问题与对话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文