2

我遵循了这些步骤并做了完全相同的事情:

http://www.slideshare.net/androidstream/action-bar-sherlock-tutorial

但问题是com_actionbarsherlock它的 src 文件夹文件中有很多错误。

大多数(或不知道是否全部)错误是这样的:

The method onPreparePanel(int, View, Menu) of type _ActionBarSherlockTrojanHorse must override a superclass method

图书馆清单有这个:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.actionbarsherlock"
    android:versionCode="90"
    android:versionName="4.1.0" >

    <uses-sdk
        android:minSdkVersion="4"
        android:targetSdkVersion="14" />

</manifest>

项目构建目标是 API 14

我的项目清单有这个:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.sherlock"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="10" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 
        android:theme="@style/Theme.Sherlock">
        <activity
            android:name=".SherlockActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

并且项目构建目标是 API 10

这个怎么解决??

谢谢

4

1 回答 1

3

从本周的博客文章中引用自己的话:

有两种方法可以解决此问题。

For an individual project, you can go into Project > Properties, choose the “Java Compiler” category on the left, and change the value in the “Compiler compliance level” drop-down. Sometimes, this will be disabled, because you are using your workspace-level setting and are not overriding it at the project level. Sometimes, though, the project might be set to override it at the project level and have it set to 1.5. If you would prefer to not override it on a project where it is overridden, you can uncheck the “Enable Project Specific Settings” checkbox at the top of the dialog.

For your entire workspace, you can go to the Preferences window and choose Java > Compiler from the category tree on the left. Here, you will see another “Compiler compliance level” drop-down, one that controls the default for all of your projects.

保持一致的 1.6 编译器合规级别将清除这些 @Override 投诉。

于 2012-08-18T11:31:03.263 回答