有人帮助我关闭我的力量

时间:2013-06-05 16:02:59

标签: android logcat deprecated forceclose

有人可以帮我弄清楚我的应用有什么问题: 香港专业教育学院过去3天尝试弄清楚它是什么,但没有运气 还有为什么画廊被弃用了....我用什么代替 这就是我的应用程序强行关闭的原因 如果你需要我的.java代码让我知道 谢谢你的帮助  这里Logcat

06-05 16:50:33.234: D/skia(19241): --- allocation failed for scaled bitmap
06-05 16:50:33.234: D/AndroidRuntime(19241): Shutting down VM
06-05 16:50:33.241: W/dalvikvm(19241): threadid=1: thread exiting with uncaught     exception (group=0x40bdda08)
06-05 16:50:33.241: E/AndroidRuntime(19241): FATAL EXCEPTION: main
06-05 16:50:33.241: E/AndroidRuntime(19241): java.lang.OutOfMemoryError
06-05 16:50:33.241: E/AndroidRuntime(19241):    at     android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:786)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.content.res.Resources.loadDrawable(Resources.java:2013)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at     android.content.res.Resources.getDrawable(Resources.java:680)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.ImageView.resolveUri(ImageView.java:616)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.ImageView.setImageResource(ImageView.java:349)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at com.istyleevents.ImageAdapter.getView(ImageAdapter.java:45)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.AbsSpinner.onMeasure(AbsSpinner.java:193)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.View.measure(View.java:15518)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at   android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.View.measure(View.java:15518)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.View.measure(View.java:15518)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at  android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.View.measure(View.java:15518)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2176)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.View.measure(View.java:15518)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:989)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.Choreographer.doCallbacks(Choreographer.java:562)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.Choreographer.doFrame(Choreographer.java:532)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.os.Handler.handleCallback(Handler.java:725)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.os.Handler.dispatchMessage(Handler.java:92)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.os.Looper.loop(Looper.java:137)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at android.app.ActivityThread.main(ActivityThread.java:5229)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at java.lang.reflect.Method.invokeNative(Native Method)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at java.lang.reflect.Method.invoke(Method.java:525)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
06-05 16:50:33.241: E/AndroidRuntime(19241):    at dalvik.system.NativeStart.main(Native Method)
06-05 16:50:35.585: I/Process(19241): Sending signal. PID: 19241 SIG: 9

2 个答案:

答案 0 :(得分:0)

OutOfMemoryError。您的应用程序正在填充设备的内存。也许这种情况正在发生:

  • 您的应用程序因某种原因故意在内存中分配大量数据(图像),而无需控制设备释放的内存量。
  • 您的应用程序不会释放以前分配的数据(不再使用)(打开图像,关闭时不释放内存)。
  • 其他一些类型的内存泄漏。

您应该阅读有关内存泄漏的信息。这里有一些信息:http://android-developers.blogspot.com.es/2009/01/avoiding-memory-leaks.html

另外,也许图像太大了。您必须在加载之前调整它的大小。

答案 1 :(得分:0)

如果在模拟器上进行测试,请尝试通过AVD管理器编辑来增加AVD的VM堆大小。