Following this tutorial http://www.michenux.net/android-around-me-tutorial-974.html and using Android-Universal-Image-Loader I've create a custom listview where I want to show one imageview and three textview.
This is the listview row:
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:id="@+id/llLogo"
android:orientation="vertical"
android:layout_centerVertical="true">
<ImageView
android:layout_width="50dip"
android:layout_height="50dip"
android:id="@+id/ivLogo"
android:src="@drawable/ic_launcher"
android:scaleType="fitXY"
android:adjustViewBounds="true">
</ImageView>
</LinearLayout>
<LinearLayout
android:id="@+id/llTextos"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/llLogo"
android:layout_marginLeft="2dp"
android:orientation="vertical">
<TextView
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_width="wrap_content"
android:id="@+id/tvNom"
android:textColor="#000099">
</TextView>
<TextView
android:layout_height="wrap_content"
android:text="TextView"
android:maxLines="3"
android:ellipsize="marquee"
android:layout_width="wrap_content"
android:id="@+id/tvDescripcio">
</TextView>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="TextView"
android:id="@+id/tvDistancia"
android:textStyle="bold"
android:textColor="#ff0000">
</TextView>
</LinearLayout>
And this is the part of the adapter where I fill the row with the data.
public View getView(int position, View convertView, ViewGroup parent) {
PlaceHolder placeHolder;
if (convertView == null) {
convertView = View.inflate(context, R.layout.listview_row_empreses, null);
placeHolder = PlaceHolder.generate(convertView);
convertView.setTag(placeHolder);
} else {
placeHolder = (PlaceHolder) convertView.getTag();
}
placeHolder.nom.setText(empreses.get(position).getNom());
placeHolder.descripcio.setText(empreses.get(position).getDescr_curta());
placeHolder.distancia.setText(empreses.get(position).getLatitud());
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(R.drawable.ic_launcher)
.showImageForEmptyUri(R.drawable.ic_launcher)
.showImageOnFail(R.drawable.ic_launcher)
.cacheInMemory(true)
.cacheOnDisk(true)
.displayer(new RoundedBitmapDisplayer(20))
.build();
ImageLoader.getInstance().displayImage(empreses.get(position).getLogo(), placeHolder.logotip);
Log.d("TAG", "URL imatge obtesa: " + empreses.get(position).getLogo());
return (convertView);
}
I'm getting the data from a sqlite database.
When I execute the app, the textview are filled with the right information, but the imageview remains blank. The ic_launcher disappears and none picture is shown.
In the logcat appears this shown in green:
05-27 19:15:54.607: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:54.737: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:54.747: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:54.757: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:54.777: I/System.out(10203): resolveUri failed on bad bitmap uri: 05-27 19:15:54.897: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:54.977: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.007: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.057: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.117: I/System.out(10203): resolveUri failed on bad bitmap uri: 05-27 19:15:55.267: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.287: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.317: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.327: I/System.out(10203): resolveUri failed on bad bitmap uri: (I don't have enough reputation to show more than 2 links. Here in the logcat shows the url of the picture) 05-27 19:15:55.347: I/System.out(10203): resolveUri failed on bad bitmap uri:
Which can be the problem?
I couldn't find where was exactly the problem, buy I solved it using the picasso library.