小编use*_*354的帖子

无法找到提供商信息错误

我正在尝试使用contentprovider,但是我遇到了麻烦,因为我收到了"无法找到com.example.alex.hopefulyworks的提供商信息"的错误

这是清单和内容提供者

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.alex.hopefulythisworks" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            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=".ColorContentProvider"
            android:authorities="com.example.alex.hopefulythisworks.ColorContentProvider"
            android:enabled="true"
            android:exported="true" >
        </provider>

    </application>

</manifest>





    package com.example.alex.hopefulythisworks;
     ....
    public class ColorContentProvider extends ContentProvider {

    private ColorHelper database;

    private static final String AUTHORITY
            = "com.example.alex.hopefulythisworks";

    private static final String BASE_PATH
            = "tasks";

    public static final Uri CONTENT_URI
            = Uri.parse("content://" + AUTHORITY + "/" + BASE_PATH);
    public static final String …
Run Code Online (Sandbox Code Playgroud)

android android-contentresolver android-contentprovider

11
推荐指数
2
解决办法
2万
查看次数