private void async(List<String> listImage) { m_urls = listImage; for (int i = 0; i < listImage.size(); i++) { ImageView image = new ImageView(Tools.getApplicationContext()); final AQuery aq = new AQuery(image); AQueryHelper qh = new AQueryHelper(aq, image, listImage.get(i)).failDrawable(R.drawable.placeholder_big); qh.loadImage(); } }
@Override public void onCreate() { super.onCreate(); Tools.initialize(getApplicationContext()); JsonCacheDbHelper.setDbVersion(BuildConfig.VERSION_CODE); JsonCacheDbHelper.setListener( new JsonCacheDbHelper.Listener() { @Override public void onException(Throwable e, String addon) { log(e); // Tools.gaTrackerPostException(e, addon); } }); }
private void syncWithAssets(List<String> listImage) { for (int i = 0; i < listImage.size(); i++) { ImageView image = new ImageView(Tools.getApplicationContext()); InputStream ims = null; try { ims = getResources().getAssets().open(listImage.get(i)); } catch (IOException e) { e.printStackTrace(); } // load image as Drawable Drawable d = Drawable.createFromStream(ims, null); // set image to ImageView image.setImageDrawable(d); } }