Setting empty text on listView that does not have @+android:list as its ID?

by Lee » Thu, 10 Sep 2009 09:25:12 GMT


Sponsored Links
 I've got a tabhost that has a number of tabs that all contain a
ListView (among other widgets).

I need to address each ListView separately and so they all have a
unique ID that is not @+android:list.

How does one define the empty text for a list if the only way that it
can be done is through the assumption that the list will have an id of
@+id/android:list and the empty text @+id/android:empty

Thanks
Lee
--~--~---------~--~----~------------~-------~--~----~



Setting empty text on listView that does not have @+android:list as its ID?

by Mark Murphy » Thu, 10 Sep 2009 09:33:15 GMT


 


For an empty list, just make the ListView be invisible
(setVisibility(View.INVISIBLE)) and make an associated TextView be
visible. Use FrameLayout (or RelativeLayout) so they can take up the
same space in the GUI, just one or the other being visible.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Android Programming Tutorials_ Version 1.0 Available!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Library development - Development requirements

Hi,

Can anyone explaing what Table 1 ("Minimum versions of SDK tools and
plaforms on
which you can develop library projects.")'s columns really mean. Table is here:

http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject

I.e.

component: Android 1.5 platform, minimum version: r4 or higher

but

component: Android 2.2 plaftorm, minimum version: r1 (or higer).

Blame my English, but I simply do not get what this minimum version
really refer to. Thanks in advance

-- 

2. URLConnection TimeOut

Hi all,

I have a problem in my code ,runs on the emulator very well,but on my
T-mobile G1 doesn't time out .Code snippet is below :-

URL myURL = new URL(uriBuilder.toString());
URLConnection myConnection = myURL.openConnection();
       myConnection.setConnectTimeout(40000);

so when no internet connection it doesn't time out at all !!!!!

any Idea ?
-- 
tarek

-- 

3. mengenai bluetooth hero

4. repost : WTB : Android & dkk

5. How to create a chooser to pick an image with any application?

6. Desire Pays Froyo Sense v1.

7. Missed call question