android.view.InflateException Caused by: java.lang.OutOfMemoryError -
This problem occurs only on some devices, but crashes the entire app for those users.
The app loads two images at a time, is a basic, a staining copy for a scrolling effect. I am now using Picasso to load images which reduce issues Gives it, but it still happens to choose something.
A new set of images (original and dimmed) is opened every time the app is opened.
This type of images are initialised in onCreateView method:
nonBlurImageView = (imageView) layoutView.findViewById (R.id.orginal_image); .. Picasso.with (getActivity ()) Load (GetResources () getIdentifier (bgNum, "drawable", getActivity () getPackageName ())) (nonBlurImageView); BlurredImageView = (ImageView) layoutView.findViewById (R.id.blored_image); . In Picasso.with (getActivity ()) load (. GetResources () getIdentifier (bgNum + "_ blur", "drawable", getActivity () getPackageName ()).) (BlurredImageView). with stack trace starts
android.view.InflateException: binary XML file line # 24: error class & lt; Unknown & gt; android.view.LayoutInflater.createView (LayoutInflater.java:626) com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView (PhoneLayoutInflater.java:56) on android.view.LayoutInflater.onCreateView (on LayoutInflater.java:675 ) Where is # 24
& lt; imageView android: id = "@ + id / orginal_image" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" Android: scaleType = "centerCrop" Android: src = "@ drawable / Biji_l" / & gt; Is there a problem with GC or some things? Is this a better way?
Thank you!
It's beautiful though it's late, but nobody can stumble over here I have almost this The problem was that my app crashed in the beginning because it tries to load an empty string in a ImageView . Empty string throws an exception inside Piccasso.load () method, but null does not null instead loads placeholder . Then first try to see your URL if its blank or your image ressource id is equal to zero and if so, use null instead. " Hope this will help: D
Comments
Post a Comment