上海网站建设渠道苏州百度推广开户
注意接口是如何只有一个方法(完成(ParseException的E))。那么当我尝试创建一个像教程这样的助手类时,我提出需要实现的不仅仅是该方法,而是来自一些随机模糊的ParseCallback1接口的另一种方法。
生成的界面如下:
// Metadata.xml XPath interface reference: path="/api/package[@name='com.parse']/interface[@name='SendCallback']"
[Register ("com/parse/SendCallback", "", "Com.Parse.ISendCallbackInvoker")]
public partial interface ISendCallback : global::Com.Parse.IParseCallback1 {
// Metadata.xml XPath method reference: path="/api/package[@name='com.parse']/interface[@name='SendCallback']/method[@name='done' and count(parameter)=1 and parameter[1][@type='com.parse.ParseException']]"
[Register ("done", "(Lcom/parse/ParseException;)V", "GetDone_Lcom_parse_ParseException_Handler:Com.Parse.ISendCallbackInvoker, ParseBindings")]
void Done (global::Com.Parse.ParseException
}
它从ParseCallback1延伸,但为什么它在Java中我只需要实现一个方法,在这里这两个?
最重要的是该接口是不公开的罐子,所以当我编译使用这个辅助类项目:
internal partial class SendCallbackEventMapper : Java.Lang.Object,
Com.Parse.ISendCallback
{
public void Done(Com.Parse.ParseException e) {
}
public void Done(Java.Lang.Object o) {
}
}
我得到附加的文件中的错误。
Error: error: ParseCallback1 is not public in com.parse; cannot be accessed from outside package
com.parse.ParseCallback1
(ParsePush)
Error: error: name clash: done(Throwable) in SendCallbackEventMapper and done(T) in ParseCallback1 have the same erasure, yet neither overrides the other
public void done (java.lang.Throwable p0)
where T is a type-variable:
T extends Throwable declared in interface ParseCallback1
(ParsePush)
我在这里有什么选择?我真的需要实现这些方法。我甚至无法使用提供的接口(如SendCallback)和这些错误,因此我无法真正使用Parse SDK中的任何InBackground方法。
2015-03-24
Eddnav