0
12-11 23:38:42.568: ERROR/AndroidRuntime(4261): FATAL EXCEPTION: main
12-11 23:38:42.568: ERROR/AndroidRuntime(4261): android.view.InflateException: Binary XML file line #11: Error inflating class <unknown>
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at xxx.PickLeafCell.<init>(PickLeafCell.java:38)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at xxx.CueFileListAdapter.getView(CueFileListAdapter.java:108)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.ListView.makeAndAddView(ListView.java:1727)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.ListView.fillSpecific(ListView.java:1272)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.ListView.layoutChildren(ListView.java:1558)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.AbsListView.onLayout(AbsListView.java:1147)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.View.layout(View.java:7035)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.RelativeLayout.onLayout(RelativeLayout.java:909)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.View.layout(View.java:7035)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.View.layout(View.java:7035)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.View.layout(View.java:7035)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.View.layout(View.java:7035)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.os.Looper.loop(Looper.java:123)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.app.ActivityThread.main(ActivityThread.java:4627)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at java.lang.reflect.Method.invokeNative(Native Method)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at java.lang.reflect.Method.invoke(Method.java:521)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at dalvik.system.NativeStart.main(Native Method)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261): Caused by: java.lang.reflect.InvocationTargetException
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.ImageView.<init>(ImageView.java:108)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at java.lang.reflect.Constructor.constructNative(Native Method)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     ... 34 more
12-11 23:38:42.568: ERROR/AndroidRuntime(4261): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.Bitmap.nativeCreate(Native Method)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.content.res.Resources.loadDrawable(Resources.java:1709)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     at android.widget.ImageView.<init>(ImageView.java:118)
12-11 23:38:42.568: ERROR/AndroidRuntime(4261):     ... 38 more
4

2 に答える 2

1

あなたの問題はここにあります:

java.lang.OutOfMemoryError: bitmap size exceeds VM budget

大きな画像を読み込んでいるようです。これには複数のオプションがあります: 1. BitmapOptions を使用してサイズを取得し、スケールを計算してから、必要なスケールでのみデコードします。

  1. デバイスのニーズに合わせて、PC で直接画像のサイズを変更します。

このトピックの必読ページは次のとおりです: Android 開発者

PS。ここで重要なことは、UI スレッドで画像をデコードしてはならないということです。これは、アプリのパフォーマンスに影響します。

于 2013-01-24T16:19:19.407 に答える
1

サイズが大きすぎるビットマップを読み込んでいます。Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget. ただし、解決策はあります。ビットマップをより低い解像度にデコードする必要があります[方法]

于 2013-01-24T16:14:05.437 に答える