我尝试使用方形毕加索 Web 应用程序。但是如果我的 img url 包含土耳其语字符。毕加索不加载img。
此 URL 有效。 http://www.bulenttiras.com/wp-content/uploads/2014/02/kokhucre.jpg
但
此 URL 无效 http://www.bulenttiras.com/wp-content/uploads/2014/03/t%C3%BCp-bebek-tedavisi.jpg
public class CategoryAdapterClass extends BaseAdapter {
private List<CategoryHelper> categoryHelpers;
private Context context;
public CategoryAdapterClass(List<CategoryHelper> categoryHelpers, Context context) {
this.categoryHelpers = categoryHelpers;
this.context = context;
}
@Override
public int getCount() {
return categoryHelpers.size();
}
@Override
public CategoryHelper getItem(int position) {
return categoryHelpers.get( position );
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
CategoryHelper categoryHelper = getItem( position );
if( convertView == null ) {
viewHolder = new ViewHolder();
convertView = LayoutInflater.from( context ).inflate(R.layout.all_categories_inflate, parent, false);
viewHolder.categoryImage = (ImageView) convertView.findViewById( R.id.categoryImage );
viewHolder.category_title = (TextView) convertView.findViewById( R.id.category_title );
viewHolder.category_excerpt = (TextView) convertView.findViewById( R.id.category_excerpt );
convertView.setTag( viewHolder );
}
else {
viewHolder = (ViewHolder) convertView.getTag();
}
String query = null;
try {
query = URLEncoder.encode(categoryHelper.getCategory_image(), "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
viewHolder.category_title.setText( categoryHelper.getCategory_image() );
viewHolder.category_excerpt.setText( categoryHelper.getCategory_excerpt() );
Picasso.with( context ).load( query ).into( viewHolder.categoryImage );
return convertView;
}
private class ViewHolder {
ImageView categoryImage;
TextView category_title;
TextView category_excerpt;
}
}
请帮忙。对不起英语不好。谢谢你。