错误的参数传递给universal-Image中的displayImage方法

时间:2013-06-27 10:47:12

标签: android universal-image-loader

我使用这个库很多时间。但是我从Eclipse获得了标题名称的异常。代码在这里;

public class HaberDetay extends Activity {

private HaberlerItems haberitem = null;
private ImageLoader imageloader;
private ImageView haberImage;
private TextView lblTitle, lblDescription, lblTarih;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_haber_detay);

    imageloader = ImageLoader.getInstance();
    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
            getApplicationContext()).build();
    imageloader.init(config);

    lblTitle = (TextView)findViewById(R.id.lblTitle);
    lblDescription = (TextView)findViewById(R.id.lblDescription);
    lblTarih = (TextView)findViewById(R.id.lblTarih);
    haberImage = (ImageView)findViewById(R.id.imgHaber);

    haberitem = (HaberlerItems)getIntent().getSerializableExtra("haberitem");

    if(haberitem != null){
        lblTarih.setText(haberitem.getDateAdded());
        lblTitle.setText(haberitem.getTitle());
        lblDescription.setText(Html.fromHtml(haberitem.getDescription()));
        imageloader.displayImage(haberitem.getImageUrl(), haberImage);
    }

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.haber_detay, menu);
    return true;
}

}

你知道displayImage是这个类的一个方法。我看不到任何错误或异常。我该怎么办?

1 个答案:

答案 0 :(得分:0)

displayImage的参数是位置,视图和选项

 imageLoader.displayImage(imageUrls[position], imageView, options);

查看示例

https://github.com/nostra13/Android-Universal-Image-Loader/blob/master/sample/src/com/nostra13/example/universalimageloader/ImageGalleryActivity.java