Hi, You are blocking the UI thread. Basically you are preventing ListView from ever doing a layout or a redraw. You should use a Handler or an AsyncTask to do this.
On Wed, May 20, 2009 at 10:01 PM, Freshman <[email protected]> wrote: > > Hi guys, > > I am new to Android I've a ListView. > I want to autoscroll all the items of listview on button click event > with some specified time interval, > and also wants to update the TextView according to selected items. > I tried something like this on button click > > for(inti=0;i<=length;i++){ > getListView().setSelection(i); > textview.setText("Hi !" + i); > Thread.sleep(1000); > } > > After some time It will directly scrolls to last element. > And TextView dosen't get updated every time, it'll only shows last > element of listview. > > Could you please suggest me any ways to solve this problem ? > > Thanks in advance, > freshman > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

