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. how to edit the resource.arsc file in the android APK package

Hi,

I would like to edit the resource.arsc file with the android APK
package.

Addition/modification of the string values.

Br,
Vikram
--~--~---------~--~----~------------~-------~--~----~

2. How to import com.android.internal.telephony.Phone?

Hi there,
I'm trying to invoke the functions belong to class phone and
PhoneFactory. But when I'm trying to import these packages, it reminds
errors:

code:
import com.android.internal.telephony.Phone
import com.android.internal.telephony.PhoneFactory
...
PhoneFactory.makeDefaultPhones(this)
Phone phone = PhoneFactory.getDefaultPhone()

error:
The com.android.internal.telephony.Phone can not be resolved.
The com.android.internal.telephony.PhoneFactory can not be resolved.

But some other packages can be imported. I don't know why. I think all
this packages should be included in the SDK.
Can any one tell me where I am getting wrong?
Thanks.
Nio
--~--~---------~--~----~------------~-------~--~----~

3. Could not load CSS from local html file. Is functionloadDataWithBaseURL() has some problem or I need to call some other function.

4. Could title bar of activity listen to click event?

5. java.lang.reflect.InvocationTargetException during calling a function of another application at runtime

6. How to use two different icon in two different themes

7. Question regarding adding a view that can overlap other views in the layout/activity.