outOfMemoryException个人资料图片

时间:2013-04-11 21:37:46

标签: java android

我有很多ProfilePictureView的元素,我把它们的facebook个人资料图片,但是如果我有很多图片要下载,我会得到一个OutOfMemoryException。

我使用我的galaxy s2进行检查

我该如何处理它?<​​/ p>

这是我的代码:

ProfilePictureView ppv= (ProfilePictureView) v.findViewById(R.id.chatitemfriendProfilePic);
            ppv.setProfileId(facebookIds.get(position));

这是logcat:

04-12 00:28:09.860: E/AndroidRuntime(8532): FATAL EXCEPTION: main
04-12 00:28:09.860: E/AndroidRuntime(8532): java.lang.OutOfMemoryError
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.Bitmap.nativeCreate(Native Method)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:374)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:404)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.facebook.widget.ProfilePictureView.setBlankProfilePicture(ProfilePictureView.java:398)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.facebook.widget.ProfilePictureView.refreshImage(ProfilePictureView.java:388)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.facebook.widget.ProfilePictureView.setProfileId(ProfilePictureView.java:227)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.example.s.ProfileActivity$chatDialog.getView(ProfileActivity.java:1665)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.AbsListView.obtainView(AbsListView.java:2014)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.ListView.onMeasure(ListView.java:1155)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.forceUniformWidth(LinearLayout.java:905)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:885)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2092)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.View.measure(View.java:12723)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1442)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.os.Looper.loop(Looper.java:137)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at android.app.ActivityThread.main(ActivityThread.java:4575)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at java.lang.reflect.Method.invokeNative(Native Method)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at java.lang.reflect.Method.invoke(Method.java:511)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
04-12 00:28:09.860: E/AndroidRuntime(8532):     at dalvik.system.NativeStart.main(Native Method)

0 个答案:

没有答案