android - ResumeTag not working (V2.4.0) -
i exciting use tags , priority property picasso, can't seem make work. got activity loading images and, when conditions met, semi-transparent activity comes in front of activity , load image.
when set priority on high second image loading, still downloads first activity's images before loading "main" one.
so put tag on first images loading, pause when load other one, , resume when leaving second activity. never resumes.
in first activity i've got code :
final static string tag_picasso = "com.sien.ur.urstore_firstactivity_fragment"; if (!textutils.isempty(resource)) { picasso.with(parent.getcontext()) .load(resource) .tag(tag_picasso) .resize(wcol, wcol) .centercrop() .placeholder(r.drawable.default_loader_wallpapers) .error(r.drawable.default_loader_wallpapers) .into(holder.imageview); } else { holder.imageview.setimageresource(r.drawable.ur_icons_wp); }
here code second activity :
public class displaythemeactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.display_theme); findviewbyid(r.id.display_theme_close_btn).setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { finish(); } }); string pckg = "com.sien.theme.beach1"; if (!textutils.isempty(pckg)) { new displaythemeinfosfetcher(this, (relativelayout) findviewbyid(r.id.display_theme_main_layout)).execute(pckg); }else{ finish(); } } private class displaythemeinfosfetcher extends asynctask<string, void, result<composite>> { context context; relativelayout view; public displaythemeinfosfetcher(context ctx, relativelayout layout) { this.context = ctx; this.view = layout; } @override protected result<composite> doinbackground(string... strings) { return catalogservice.getinstance(context).loadbypckg(strings[0]); // has done away main thread } @override protected void onpostexecute(result<composite> result) { if (result.succeeded()) { try { final composite.app composite = (composite.app) result.getvalue(); if (composite != null) { picasso.with(context).pausetag(firstactivity.tag_picasso); // pauses corectly picasso.with(context).load(composite.getresource(5)).skipmemorycache().priority(picasso.priority.high).into((imageview) view.findviewbyid(r.id.display_theme_img)); view.findviewbyid(r.id.display_theme_btn).setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { finish(); } }); view.findviewbyid(r.id.display_theme_img).setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { finish(); } }); } } catch (nullpointerexception ignored) { } } } } @override protected void onstop() { picasso.with(this).resumetag(urwallpapersfragment3d.tag_picasso); // never resume super.onstop(); } }
do wrong here ?
Comments
Post a Comment