ListAdapter: View.GONE on some element

by arnouf » Tue, 14 Apr 2009 21:10:38 GMT

Sponsored Links
 Hi all,

I've a big issue...

In a ListView using a BaseAdpater extension, I would like hide some
entries (using View.GONE in my getView method).

The line is erase, but i've still grey line between each record.

How can I change that?

Thanks a lot!


ListAdapter: View.GONE on some element

by Dianne Hackborn » Wed, 15 Apr 2009 01:49:41 GMT

 That is not how ListView is supposed to work.  You need to make the actual
entry in the adapter disappear.

Dianne Hackborn
Android framework engineer

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.


Sponsored Links

Other Threads

1. Service thread priority

I have two apps that use a service to upload and download files and
data. I've noticed that when the service gets very busy, it can cause
the UI to block, up to the point that Android shows a "force quit/
wait" popup. In order to avoid that, I run tasks in a service at a
lower priority. This way, the service will never cause the UI to
hickup. Also, the service stops if the app hasn't been used for a
certain number of minutes. I don't want to keep resources if the user
isn't using my app.

I have found that some of my users run apps that run services
permanently at normal priority. Such a service starts at phone switch
on, and keeps running indefinitely, downloading vast amounts of data.
My policy of being nice to other apps doesn't pay off: these agressive
third party services push my service away so it never gets anything
done. As one of my users told me, my app has hickups, until he kills
the service of this app X, after which my app runs smoothly, snappy,
and fast.

My question is, should I be nice to other apps and to the UI in my own
app, or should I just run a service and agressively take all resources
I need - or don't need? This is one issue where Android is different
from iPhone. We can run services, but by doing so, we can cause damage
to other peoples apps. Of course, my "question" doesn't require an
answer. I'm just curious after what other people think, what your
experience here is.


2. Cannot play audio on some phones

I am vexed by the variety of ways various phones can choose or choose
not to play an MP3 file I have in my app as a raw asset.

My preferred way to do this:
MediaPlayer mp = MediaPlayer.create(this, resId);

returns NULL on HTC Hero, and seemingly some Erises.

So when THAT happens, I do

mp = new MediaPlayer();

// copies the resource to a file with suffix .mp3
String fname = copyResourceToFile(resId, ".mp3");

But, in one case at least on an Eris, I still saw a machine report an
IOException on mp.prepare(), with status 0x01

Is there some way I can get this to just work?


3. Booting Failure

4. Which IDE is better for kernel development?Is it possible in windows?

5. how do I load the new compiled kernel on my android dev phone 2 (htc)?

6. Is there any issues bugs or upgrade to Android kernal?

7. Why some threads have no reply option?