我有一个名称为G的类,该类是从Application扩展的,这是该类:

public class G extends Application {

public static Context ctx;
@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();

    ctx = this.getApplicationContext();
  }
 }


AndroidManifest.xml中,我像这样添加了此类:

<?xml version="1.0" encoding="utf-8"?>
<uses-sdk android:minSdkVersion="8" />

<application
    andriod:name=".G"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".DatabaseTestActivity"
        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>


但这给了我这个错误:The prefix "andriod" for attribute "andriod:name" associated with an element type "application" is not bound.

有什么问题 ?

编辑:这是我的AndroidManifest.XML

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

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

  <application
    andriod:name="na.pe.database.G"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".DatabaseTestActivity"
        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>

最佳答案

请注意,您的属性名称中存在拼写错误

andriod:name
    ^

关于android - 与元素类型“application”相关联的属性“andriod:name”的前缀“andriod”是否绑定(bind)?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28250756/

10-12 03:05