这是在我的 android 设备上调试时出现的错误。但是,在模拟器上运行我的应用程序时,它返回的一切都完全正确。
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
at android.content.res.Resources.loadDrawable(Resources.java:2854)
at android.content.res.Resources.getDrawable(Resources.java:1521)
at android.widget.ImageView.resolveUri(ImageView.java:628)
at android.widget.ImageView.setImageResource(ImageView.java:361)
at com.example.prof_mohamed.ksa.accmanagerAdapter.getView(accmanagerAdapter.java:72)
at android.widget.AbsListView.obtainView(AbsListView.java:2570)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1253)
at android.widget.ListView.onMeasure(ListView.java:1165)
at android.view.View.measure(View.java:16420)
at android.widget.RelativeLayout.measureChild(RelativeLayout.java:666)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:477)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChild(ViewGroup.java:5025)
at android.support.constraint.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:393)
at android.support.constraint.ConstraintLayout.onMeasure(ConstraintLayout.java:419)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5055)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5055)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:391)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5055)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5055)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
at android.view.View.measure(View.java:16420)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5055)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2549)
at android.view.View.measure(View.java:16420)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2188)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1333)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1544)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1230)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5089)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:561)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.A*ctivityThread.main(ActivityThread.java:5283)
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:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
任何机构都可以帮助解决这个问题。谢谢你