由于此 RuntimeException,我的应用程序无法启动:
java.lang.RuntimeException: Unable to get provider org.worldsproject.android.barcode.database.DatabaseProvider: java.lang.ClassNotFoundException: org.worldsproject.android.barcode.database.DatabaseProvider
我的清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.worldsproject.android.barcode"
android:versionCode="4"
android:versionName="1.0.3" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" >
<activity
android:name="BarcodeSaleTracker"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:name="org.worldsproject.android.barcode.database.DatabaseProvider"
android:multiprocess="true"
android:exported="false"
android:authorities="org.worldsproject.android.barcode.database.DatabaseProvider" />
</application>
我的数据库提供者:
package org.worldsproject.android.barcode.database;
public class DatabaseProvider extends ContentProvider{
private static final String TAG = "DatabaseProvider";
private static final String DATABASE_NAME = "sales.db";
private static final int DATABASE_VERSION = 1;
public static final String AUTHORITY = "org.worldsproject.android.barcode.database.DatabaseProvider";
权限和名称属性都正确且匹配,所以我不确定为什么它找不到类。