: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/
On May 12, 9:12 am, Dianne Hackborn <hack...@android.com> wrote: > Don't re-inflate each time. Implement this correctly, where you re-use the > convertView if it is given. Just make sure you have the states of the views > set up correctly before you return. > > > > > > > > > > On Thu, May 12, 2011 at 8:14 AM, authorwjf <wfran...@softlayer.com> wrote: > > Yahel's post got me to thinking. I modified the getView method of my > > data adapter to look like this: > > > @Override > > public View getView(int position, View convertView, ViewGroup parent) > > { > > LayoutInflater vi = > > (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE); > > View v = vi.inflate(R.layout.list_view_row, null); > > TextView label = (TextView) v.findViewById(R.id.label); > > ImageView spinner = (ImageView) v.findViewById(R.id.spinner); > > MyContainer item = (MyContainer) items.get(position); > > label.setText(item.getText()); > > spinner.setVisibility(View.INVISIBLE); > > if (item.isLoading()) { > > label.setText("***"+item.getText()+"***"); > > spinner = (ImageView)v.findViewById(R.id.spinner); > > spinner.setVisibility(View.VISIBLE); > > Animation spinnerAnimation = > > AnimationUtils.loadAnimation(getContext(), R.anim.rotate); > > spinner.startAnimation(spinnerAnimation); > > } > > return v; > > } > > > And the problem seems resolved! Great news for me. Though I wonder > > if any of you can comment as to the performance hit / impact I might > > expect to take reloading the view from the layout every single time > > the adapter refreshes? I'm not experiencing any issues with the demo > > program, but the lists in my actual application can get rather long > > and include several lines of text for each row. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Dianne Hackborn > Android framework engineer > hack...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en