简体   繁体   English

Eclipse上的Alfresco Mobile Android错误

[英]Alfresco Mobile Android Error on Eclipse

I download alfresco android sdk 1.0.1 from this link then I unzip file. 我从这个链接下载alfresco android sdk 1.0.1然后我解压缩文件。

After that I open my eclipse, create new workspace then click FIle -> Import -> Android -> Existing Android Code Into Workspace -> Root Directory I browse in unzip sdk -> Select All -> Check Copy Projects into workspace -> Finish 之后我打开我的eclipse,创建新工作区,然后单击FIle - > Import - > Android - >现有Android代码进入工作区 - >根目录我浏览解压缩sdk - >全选 - >选中将项目复制到工作区 - >完成

Then I Found many error in src directory, for example like this code 然后我在src目录中发现了很多错误,例如像这样的代码

@Override
public Loader<LoaderResult<PagingResult<ActivityEntry>>> onCreateLoader(int id, Bundle ba)
{
    if (!hasmore)
    {
        setListShown(false);
    }

    // Case Init & case Reload
    bundle = (ba == null) ? getArguments() : ba;

    ListingContext lc = null, lcorigin = null;

    if (bundle != null)
    {
        lcorigin = (ListingContext) bundle.getSerializable(ARGUMENT_LISTING);
        lc = copyListing(lcorigin);
        loadState = bundle.getInt(LOAD_STATE);
    }
    calculateSkipCount(lc);
    ActivityStreamLoader loader = new ActivityStreamLoader(getActivity(), alfSession);
    loader.setListingContext(lc);
    return loader;
}

Error mark on second line (public Loader ...) Eclipse said: 第二行出现错误标记(public Loader ...)Eclipse说:

Multiple markers at this line
- The methode onCreateLoader(int, Bundle) of type ActivityStreamFragment must override a superclass method
- implements android.app.LoaderManager.LoaderCallbacks<org.alfresco.mobile.android.api.asynchronous.LoaderResult<org.alfresco.mobile.android.api.model.PagingResult<org.alfresco.mobile.android.api.model.ActivityEntry>>>.onCreateLoader

That I want to know is what should I do to solve this error? 我想知道我该怎么做才能解决这个错误? Because I want to build alfresco android with that source code.. 因为我想用该源代码构建alfresco android ..

Note: I using alfresco-android-sdk-1.0.1, Eclipse SDK Version: 3.7.2, jdk-1_5_0_22-windows-i586-p 注意:我使用alfresco-android-sdk-1.0.1,Eclipse SDK版本:3.7.2,jdk-1_5_0_22-windows-i586-p

Thanks 谢谢

You're using Java 1.5 (jdk-1_5_0_22-windows-i586-p) to compile your application, you need to upgrade your compiler to 1.6 as some changes were made to the @Override annotation. 您正在使用Java 1.5 (jdk-1_5_0_22-windows-i586-p)来编译您的应用程序,您需要将编译器升级到1.6,因为对@Override注释进行了一些更改。

In Java 5, the @Override annotation might be applied only to the methods overriding superclass ones. 在Java 5中,@ Override注释可能仅适用于覆盖超类注释的方法。 Since Java 6 you can use the @Override annotation also with the methods that implements the interface ones. 从Java 6开始,您也可以使用@Override注释和实现接口的方法。

There is also a possibility that you may already have it installed, but not set in eclipse - you can change the compiler version in the project properties : Java Compiler -> Compiler compliance level . 您可能已经安装了它,但未在eclipse中设置 - 您可以在项目属性中更改编译器版本: Java编译器 - >编译器合规性级别

Sources: 资料来源:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM