android - Not able to make Progress Bar invisible in a List View -


Here I have a progress bar in a imageView and FrameLayout is my code for the custom adapter. After downloading images, I want to make the progress bar invisible .. I am downloading images from the web service. After downloading the images, the finishImg () method is called.

  The public class extends CustomAdapter BaseAdapter {reference mContext; ArrayList & LT; ManagePartResponse & gt; part of the list; LayoutInflator aminflator; Static viewholder VH; Public CustomAdapter (Reference Reference, ArrayList & quot; Management Pricing & gt; Item List) {mContext = context; PartList = itemList; MInflater = layoutInflator. From (context); } Public CustomAdapter (ManagePartListActivity managePartListActivity, ArrayList & LT; ManagePartResponse & gt; list) {// TODO Auto-generated constructor stub} public CustomAdapter () {} static class ViewHolder {TextView make_tv, model_tv, partName_tv, partId_tv, year_tv; ImageView imageView; Progress Bar PB; } Public int getCount () {// TODO auto generated method stub returns partList.size (); } Public object getItem (int position) {// TODO Auto-Generated Method Stub Return Status; } Public long getItemId (int position) {// TODO auto generate method stub return 0; } Public View getView (int position, View convertView, ViewGroup parent) {// TODO Auto-generated method stub if (convertView == NULL) {VH = new ViewHolder (); Convertview = mInflater.inflate (R.layout.row_3, guardian, incorrect); Vh.make_tv = (TextView) ConvertViewFindVBIID (RIDKKID); Vh.model_tv = (TextView) ConvertViewFindVBIID (RIDModelID); Vh.partName_tv = (TextView) Convertview. FindViewById (R.id.partNameId); Vh.partId_tv = (TextView) ConvertewfindvibidId (RID partId); Vh.year_tv = (TextView) ConvertViewFindVBIID (R.Did.IIRID); Vh.imageView = (ImageView) Convertview. FindVibIID (R.id.imageView1); Vh.pb = (progress bar) ConvertviewfindbackBiID (RID ProgramBar 1); ConvertView.setTag (VH); } And {vh = (seeholder) Convertview.gettag (); } Management Representation objBean = partList.get (status); Vh.make_tv.setText (objBean.getMake ()); Vh.model_tv.setText (objBean.getModel ()); Vh.partName_tv.setText (objBean.getPartName ()); Vh.year_tv.setText (objBean.getYear ()); Vh.partId_tv.setText (objBean.getStockref ()); Vh.imageView.setImageBitmap (objBean.getImage ()); Return Convertview; } Public static zero-end IMG () {vh.pb.setVisibility (see. INVISIBLE); Vh.pb.setVisibility (View.GONE); System.out.println ("Progress Bar should be invisible"); }}  

"itemprop =" text ">

You must set visibility in GetView. The reason for this is that a scroll list view will reassign the new lines seen in the list view, and if you set the visibility on a row, that item will not be updated when a new line takes you on. Note that it goes in both directions, if you want to show it you need to explicitly make this invisible disappear if you want to clearly make it visible, and want to.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -