自定义View 拓展view 没有全部实现夫view中的构造方法 ApplicationContext is null in ApplicationStatus

来源:互联网 发布:图形矢量化软件 编辑:程序博客网 时间:2024/05/17 17:46
报以下的错误:
01-08 17:22:33.223: E/AndroidProtocolHandler(17352): Unable to open asset URL: file:///android_asset/pggmall/css2/style2.css01-08 17:22:33.223: E/AndroidProtocolHandler(17352): Unable to open asset URL: file:///android_asset/pggmall/css2/4_my2.css01-08 17:23:24.393: E/SMACK-Voe(17708): enter JNI_OnLoad01-08 17:23:26.703: E/SysUtils(17708): ApplicationContext is null in ApplicationStatus01-08 17:23:26.793: E/ActivityThread(17708): Failed to find provider info for com.google.settings01-08 17:23:27.083: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/css2/style2.css01-08 17:23:27.083: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/css2/1_home2.css01-08 17:23:27.113: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_1.jpg01-08 17:23:27.113: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_2.jpg01-08 17:23:27.113: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_3.jpg01-08 17:25:17.533: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/css2/4_my2.css01-08 17:25:17.533: E/AndroidProtocolHandler(17708): Unable to open asset URL: file:///android_asset/pggmall/css2/style2.css01-08 17:26:05.263: E/SMACK-Voe(18249): enter JNI_OnLoad01-08 17:26:07.543: E/SysUtils(18249): ApplicationContext is null in ApplicationStatus01-08 17:26:07.633: E/ActivityThread(18249): Failed to find provider info for com.google.settings01-08 17:26:07.943: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/css2/style2.css01-08 17:26:07.943: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/css2/1_home2.css01-08 17:26:07.943: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_2.jpg01-08 17:26:07.943: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_1.jpg01-08 17:26:07.943: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/pic/ad_3.jpg01-08 17:26:57.223: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/css2/style2.css01-08 17:26:57.223: E/AndroidProtocolHandler(18249): Unable to open asset URL: file:///android_asset/pggmall/css2/4_my2.css01-08 17:27:00.043: E/AndroidRuntime(18249): FATAL EXCEPTION: main01-08 17:27:00.043: E/AndroidRuntime(18249): Process: com.lvche.chatuidemo, PID: 1824901-08 17:27:00.043: E/AndroidRuntime(18249): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lvche.chatuidemo/com.lvche.origin.activity.TestActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class com.lvche.origin.activity.slide_imgs.SlideViewPager01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3168)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3278)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread.access$1000(ActivityThread.java:211)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.os.Handler.dispatchMessage(Handler.java:102)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.os.Looper.loop(Looper.java:145)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread.main(ActivityThread.java:6918)01-08 17:27:00.043: E/AndroidRuntime(18249): at java.lang.reflect.Method.invoke(Native Method)01-08 17:27:00.043: E/AndroidRuntime(18249): at java.lang.reflect.Method.invoke(Method.java:372)01-08 17:27:00.043: E/AndroidRuntime(18249): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)01-08 17:27:00.043: E/AndroidRuntime(18249): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)01-08 17:27:00.043: E/AndroidRuntime(18249): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.lvche.origin.activity.slide_imgs.SlideViewPager01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.createView(LayoutInflater.java:623)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.rInflate(LayoutInflater.java:821)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.inflate(LayoutInflater.java:511)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.inflate(LayoutInflater.java:415)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.inflate(LayoutInflater.java:366)01-08 17:27:00.043: E/AndroidRuntime(18249): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:450)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.Activity.setContentView(Activity.java:2366)01-08 17:27:00.043: E/AndroidRuntime(18249): at com.lvche.origin.activity.TestActivity.onCreate(TestActivity.java:32)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.Activity.performCreate(Activity.java:6575)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3121)01-08 17:27:00.043: E/AndroidRuntime(18249): ... 10 more01-08 17:27:00.043: E/AndroidRuntime(18249): Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]01-08 17:27:00.043: E/AndroidRuntime(18249): at java.lang.Class.getConstructor(Class.java:531)01-08 17:27:00.043: E/AndroidRuntime(18249): at java.lang.Class.getConstructor(Class.java:495)01-08 17:27:00.043: E/AndroidRuntime(18249): at android.view.LayoutInflater.createView(LayoutInflater.java:587)01-08 17:27:00.043: E/AndroidRuntime(18249): ... 22 more
解决方法:实现父类中的所有构造方法


0 0