Wednesday, 15 August 2012

android - ListView doesn't resize after rows become bigger loading images from asynctask -


I have ListView which is inside TabHost There is a custom cursor adapter to return 4 different views in one of the 4 types, either an image or dragged from the SD or asset folder. Basically I was loading the image from the cursor adapter and it will hang the UI thread while every image will load, so I moved the code to AsyncTask . >

It works at all for all cases where a very small list of items is returned. When this happens, after the images are loaded, ListView is not resized and you can only scroll to the top in a small part of the screen.

I can not understand how to get listView for relay Calling Rialath and invalidating the view does not work by itself Trying to find parents to see Used to be. The default ListFragment layout already determines the height of "Match_Parent" Manually fixes a layout with all the heights set to "Match_Parent" and does not fix setting layout in the creatives notify yourself in the DataTech () < / Code> causes a single loop to call and does not resize the ListView .

With frustration, when I change, the scene looks fine before dragging a new tab before viewing the tabs. Sometimes, when I rotate the device or flick between tabs, Renders, but most of the time do not happen.

For the purposes of debugging I tried to link onListItemClick to add several relay commands and found that CallView.relayout (sometimes) resolves the problem, but not often.

On the left it loads with AsyncTask, on the right it is How it loads with the main thread loader content is on the left but you have to scroll because the list view is incorrectly in shape.

What am I missing? What is a way to retrieve ListView or the current tab or full screen?

You have to inform the inventory to recreate the inventory itself. It's expensive and you should try to avoid it. This will also cause frustration with the user because the scroll position varies. I will try to find an ideal image size and want to lock the row height / width to use that row so that dynamic content causes these problems.

  arrayAdapter.notfityDataSetChanged ();   

Should do this.

No comments:

Post a Comment