Android Exception 15(关于使用RecyclerView的异常)
1 04-07 16:32:32.815: E/AndroidRuntime(16173): FATAL EXCEPTION: main 2 04-07 16:32:32.815: E/AndroidRuntime(16173): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhy_horizontalscrollview03/com.example.zhy_horizontalscrollview03.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class com.example.zhy_horizontalscrollview03.MyRecyclerView 3 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2203) 4 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2253) 5 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread.access$600(ActivityThread.java:145) 6 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1251) 7 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.os.Handler.dispatchMessage(Handler.java:99) 8 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.os.Looper.loop(Looper.java:137) 9 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread.main(ActivityThread.java:5119) 10 04-07 16:32:32.815: E/AndroidRuntime(16173): at java.lang.reflect.Method.invokeNative(Native Method) 11 04-07 16:32:32.815: E/AndroidRuntime(16173): at java.lang.reflect.Method.invoke(Method.java:511) 12 04-07 16:32:32.815: E/AndroidRuntime(16173): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:834) 13 04-07 16:32:32.815: E/AndroidRuntime(16173): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 14 04-07 16:32:32.815: E/AndroidRuntime(16173): at dalvik.system.NativeStart.main(Native Method) 15 04-07 16:32:32.815: E/AndroidRuntime(16173): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.example.zhy_horizontalscrollview03.MyRecyclerView 16 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698) 17 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) 18 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 19 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 20 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 21 04-07 16:32:32.815: E/AndroidRuntime(16173): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:286) 22 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.Activity.setContentView(Activity.java:1929) 23 04-07 16:32:32.815: E/AndroidRuntime(16173): at com.example.zhy_horizontalscrollview03.MainActivity.onCreate(MainActivity.java:31) 24 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.Activity.performCreate(Activity.java:5232) 25 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) 26 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2167) 27 04-07 16:32:32.815: E/AndroidRuntime(16173): ... 11 more 28 04-07 16:32:32.815: E/AndroidRuntime(16173): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.zhy_horizontalscrollview03.MyRecyclerView" on path: /data/app/com.example.zhy_horizontalscrollview03-1.apk 29 04-07 16:32:32.815: E/AndroidRuntime(16173): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) 30 04-07 16:32:32.815: E/AndroidRuntime(16173): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 31 04-07 16:32:32.815: E/AndroidRuntime(16173): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 32 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.createView(LayoutInflater.java:552) 33 04-07 16:32:32.815: E/AndroidRuntime(16173): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) 34 04-07 16:32:32.815: E/AndroidRuntime(16173): ... 21 more
需要用到sdk下面 android-sdk-windows\extras\android\support\v7 下面的资源文件