[android-developers] Re: Get scroll position in a list activity

2009-03-24 Thread Mark Murphy
Ivan Soto wrote: Do you have any article/tutorial about the placeholder images to share? I'm trying to find one with no luck. I have used the technique, but not in code I'm allowed to share. I do need to more formally write this up at some point, but I do not have anything immediately handy.

[android-developers] Re: Get scroll position in a list activity

2009-03-24 Thread Streets Of Boston
I've done the same in my apps for ListView (whether they be in ListActivity or in a plain Activity) with good success. I use the java.util.concurrent's ExecutorService to obtain images: 1. Your getView(..) (or bindView/newView/etc) needs to assign an image/ thumbnail (bitmap) to an ImageView.

[android-developers] Re: Get scroll position in a list activity

2009-03-24 Thread Streets Of Boston
Here is a code-snippet. I may not compile, but i think you'll get the idea :-) [code] ExecutorService EXECUTOR = Executors.newFixedThreadPool(3); // max 3 worker threads. ... public View getView(final AbsListView listView, View convertView, int pos, long id) { ... ... final String imgUrl

[android-developers] Re: Get scroll position in a list activity

2009-03-24 Thread Ivan Soto
Thanks for explaining. Right now I'm using the efficient list method used on the ApiDemos so when the user scrolls it will refreshes the images that didn't load before. But if you don't move anything, even if the image is downloaded it won't redraw in the imageview. I will start reading about

[android-developers] Re: Get scroll position in a list activity

2009-03-24 Thread Ivan Soto
I think that's what I'm looking for. Can't wait to give it a try after work. Although, I have another thread in my main Activity downloading all pictures. Thanks, I will give it a try. Ivan Soto Fernandez Web Developer http://ivansotof.com On Tue, Mar 24, 2009 at 8:37 AM, Streets Of Boston

[android-developers] Re: Get scroll position in a list activity

2009-03-23 Thread Mark Murphy
Ivan Soto wrote: I'm trying to get the scroll position on a ListActivity. Here is what I'm trying to do: I have a list activity that is populated from an XML file. Another thread downloads all pictures so the user can see the list while the thread is still downloading the files. What I'm

[android-developers] Re: Get scroll position in a list activity

2009-03-23 Thread Romain Guy
ListView does not use scrollY. There's no need to save the scroll anyway because ListView does it for you. On Mon, Mar 23, 2009 at 6:26 PM, Ivan Soto ivanso...@gmail.com wrote: Hi, I'm trying to get the scroll position on a ListActivity. Here is what I'm trying to do: I have a list activity

[android-developers] Re: Get scroll position in a list activity

2009-03-23 Thread Ivan Soto
But when I refresh the listview with setlistadapter(listadapter) it returns to the top. Mark: Do you have any article/tutorial about the placeholder images to share? I'm trying to find one with no luck. Thanks for helping. Ivan Soto Fernandez Web Developer http://ivansotof.com On Mon, Mar

[android-developers] Re: Get scroll position in a list activity

2009-03-23 Thread Romain Guy
Don't refresh it with setListAdapter! Just modify the content of the adapter instead. On Mar 23, 2009 7:03 PM, Ivan Soto ivanso...@gmail.com wrote: But when I refresh the listview with setlistadapter(listadapter) it returns to the top. Mark: Do you have any article/tutorial about the