我在android应用程序中使用我自己的SQLite数据库。这在android 2.3及以上版本上工作正常,但android2.3下面的版本没有工作给出错误
我已在此处附加我的日志文件
02-22 03:45:58.685: W/ResourceType(475): Failure getting entry for 0x7f020000 (t=1 e=0) in package 0: 0xffffffb5
02-22 03:45:58.685: D/AndroidRuntime(475): Shutting down VM
02-22 03:45:58.685: W/dalvikvm(475): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-22 03:45:58.685: E/AndroidRuntime(475): Uncaught handler: thread main exiting due to uncaught exception
02-22 03:45:58.811: E/AndroidRuntime(475): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nframes.quotestore/com.nframes.quotestore.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2454)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2470)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.os.Handler.dispatchMessage(Handler.java:99)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.os.Looper.loop(Looper.java:123)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread.main(ActivityThread.java:4310)
02-22 03:45:58.811: E/AndroidRuntime(475): at java.lang.reflect.Method.invokeNative(Native Method)
02-22 03:45:58.811: E/AndroidRuntime(475): at java.lang.reflect.Method.invoke(Method.java:521)
02-22 03:45:58.811: E/AndroidRuntime(475): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-22 03:45:58.811: E/AndroidRuntime(475): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-22 03:45:58.811: E/AndroidRuntime(475): at dalvik.system.NativeStart.main(Native Method)
02-22 03:45:58.811: E/AndroidRuntime(475): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
02-22 03:45:58.811: E/AndroidRuntime(475): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-22 03:45:58.811: E/AndroidRuntime(475): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.Activity.setContentView(Activity.java:1622)
02-22 03:45:58.811: E/AndroidRuntime(475): at com.nframes.quotestore.MainActivity.onCreate(MainActivity.java:33)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
02-22 03:45:58.811: E/AndroidRuntime(475): ... 11 more
02-22 03:45:58.811: E/AndroidRuntime(475): Caused by: java.lang.reflect.InvocationTargetException
02-22 03:45:58.811: E/AndroidRuntime(475): at android.widget.RelativeLayout.<init>(RelativeLayout.java:171)
02-22 03:45:58.811: E/AndroidRuntime(475): at java.lang.reflect.Constructor.constructNative(Native Method)
02-22 03:45:58.811: E/AndroidRuntime(475): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
02-22 03:45:58.811: E/AndroidRuntime(475): ... 21 more
02-22 03:45:58.811: E/AndroidRuntime(475): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/title_bar_shadow.9.png from drawable resource ID #0x7f020000
02-22 03:45:58.811: E/AndroidRuntime(475): at android.content.res.Resources.loadDrawable(Resources.java:1710)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.View.<init>(View.java:1850)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.View.<init>(View.java:1799)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.view.ViewGroup.<init>(ViewGroup.java:282)
02-22 03:45:58.811: E/AndroidRuntime(475): ... 25 more
02-22 03:45:58.811: E/AndroidRuntime(475): Caused by: java.io.FileNotFoundException: res/drawable-hdpi/title_bar_shadow.9.png
02-22 03:45:58.811: E/AndroidRuntime(475): at android.content.res.AssetManager.openNonAssetNative(Native Method)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.content.res.AssetManager.openNonAsset(AssetManager.java:391)
02-22 03:45:58.811: E/AndroidRuntime(475): at android.content.res.Resources.loadDrawable(Resources.java:1702)
02-22 03:45:58.811: E/AndroidRuntime(475): ... 29 more
02-22 03:45:58.811: I/dalvikvm(475): threadid=7: reacting to signal 3
02-22 03:45:58.811: E/dalvikvm(475): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
答案 0 :(得分:0)
看起来你的事业的根源是“
FileNotFoundException: res/drawable-hdpi/title_bar_shadow.9.png
你肯定文件存在吗?
也许这可能与在hdpi
文件夹中有关。尝试创建一个新的可绘制文件夹(如果它不在您的资源中)并将图形放在那里以检查它是否有效。
如果您要为不同的屏幕尺寸编码,那么您必须要小心它不会影响您的应用。