Advanced user interface

I was trying to load an image into the listadapter using the android requests library.My problem is that progress is shown but does not disappear after the image is fully loaded.

I followed the documentation about water

see this

String imageUrl = "http://farm6.static.flickr.com/5035/5802797131_a729dac808_b.jpg";            
aq.id(R.id.image).progress(R.id.progress).image(imageUrl, false, false);

      

And the layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="100dip" 
    >

    <ProgressBar                
        android:layout_width="15dip"       
        android:layout_height="15dip"
        android:id="@+id/progress" 
        android:layout_centerInParent="true"
        />

    <ImageView
        android:id="@+id/image"       
        android:layout_width="fill_parent"       
        android:layout_height="75dip"
        />

</RelativeLayout> 

      

In my code, it looks like

  public View getView(int position, View convertView, ViewGroup parent) {
                ViewHolder holder;
                if (convertView == null) {
                    holder = new ViewHolder();
                convertView = mInflater.inflate(
                        R.layout.galleryitem, null);
                holder.imageview = (ImageView) convertView.findViewById(R.id.thumbImage);

                convertView.setTag(holder);
            }
            else {
                holder = (ViewHolder) convertView.getTag();
            }

            holder.imageview.setId(position);

            holder.checkbox.setVisibility(View.GONE);
            holder.imageview.setOnClickListener(new OnClickListener() {

                public void onClick(View v) {
                    // TODO Auto-generated method stub
                    int id = v.getId();
                    Intent ia = new Intent(getApplicationContext(),PreviewImage.class);
                    ia.putExtra("url",id);
                    startActivity(ia);

                }
            });

            AQuery aq = new AQuery(convertView);

            try{
            aq.id(holder.imageview).image(arrPath[position]).progress(R.id.progress);
            }
            catch(Exception e)
            {}

            holder.id = position;
            return convertView;
        }
    }

      

+3


source to share


1 answer


use this



aq.id(holder.imageview).progress(R.id.progress).image(arrPath[position], false, false);

      

+4


source







All Articles