0

我最初使用的是日历视图,这很好。我想在日历视图中显示我的事件,所以我尝试了扩展日历视图库。

当我导入库项目并集成代码时,出现以下错误。

 FATAL EXCEPTION: main
 android.view.InflateException: Binary XML file line #7: Error inflating class provider
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    at com.ithoughtz.sns.MainActivity$PlaceholderFragment.onCreateView(MainActivity.java:171)
    at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)
    at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:454)
    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: android.view.provider
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:643)
    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
    ... 19 more

如果我需要发布代码,请告诉我。

日历视图的 XML 如下

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

    <provider
        android:name="com.tyczj.extendedcalendarview.CalendarProvider"
        android:authorities="com.tyczj.extendedcalendarview.calendarprovider" />

    <com.tyczj.extendedcalendarview.ExtendedCalendarView
        android:id="@+id/calendar"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>
4

2 回答 2

1

provider是必须在AndroidManifast.xml项目文件中声明的标签,ContentProviders而不是在布局文件中。

provider不是xml标签,这就是您的异常堆栈说明原因的原因provider class not found

于 2017-03-21T20:03:28.377 回答
0

右键单击项目->构建路径->配置器构建路径->命令和导出->选中所有选项->按确定...

现在尝试运行您的项目

于 2014-12-08T10:58:48.503 回答