android - How to deal with Picasso OutOfMemoryError? -
I have to show with a ViewPager 50 pages, each has a different image using Picasso While doing the first 20-25 pages work perfectly. However, at that point I get a
outermomorphy error , and no images are being loaded at all:
throw out outreference error "I have been using the following code in my pager adapter : 1932496 free bytes" with failed allocation of 7477932 " / p>
@Override Public Object Instant Item (Last View Group Container, Status of Final Entity) {View View = getView (); Picasso Picasso = IMZ Loader (MCTX); Picasso Load (getUrl (position)). Fit (). In (ImageView) view.findViewById (R.id.imageview)); Container.addView (see); Return view; } @ Override Public Null Destroyed (Last View Group Container, Last Integer Status, Last Object Object) {container.removeView (see) object); } What can I do to avoid it?
I got it.
Some point notes:
- Use
skipMemoryCache ()
Use builder.executor ( executors.newSingleThreadExecutor
Use an example Picasso : do not create a new instance using Picasso.Builder < / code> code> every time. I have been able to correct my problem from last.
Comments
Post a Comment