现在我正在使用Glide-library来加载
Android Wear中的图像.大多数时候它不会加载图像.但是,它有时会加载图像.不知道我的代码出了什么问题.
注意Wear通过蓝牙连接到设备,我通过移动的Broadcast Receiver从Android Wear中成功获得了Web服务的JSON响应.除了图像外,所有数据均正常显示.
- Glide.with(mContext)
- .load("http://www.hanamoflorist.ca/images/uploads/Spring5InchesCubeVaseArrangement$45.00.jpg")
- .listener(new RequestListener<String,GlideDrawable>() {
- @Override
- public boolean onException(Exception e,String model,Target<GlideDrawable> target,boolean isFirstResource) {
- Log.e("exception in image","" + e);
- Toast.makeText(mContext,"" + e,Toast.LENGTH_LONG).show();
- return false;
- }
- @Override
- public boolean onResourceReady(GlideDrawable resource,boolean isFromMemoryCache,boolean isFirstResource) {
- return false;
- }
- }).error(R.drawable.ic_placeholder_image)
- .into(((ItemViewHolder) holder).ivCardImage);
解决方法
我想你应该使用,DaVinci在穿戴式的图像加载,
- DaVinci.with(context).load("Your Url").into(imageView);
确保使用与库相同的播放服务版本,
你可以把它加入到你的毕业生中:
穿:
- compile ('com.github.florent37:davinci:1.0.3@aar'){
- transitive = true
- }
移动:
- compile ('com.github.florent37:davincidaemon:1.0.3@aar'){
- transitive = true
- }
希望你会得到你想要的