我已经创造了一些composie的UI在我的Android应用程序,有一些的ListView控件-among一个视图中其他控制 - 。正因为如此,我曾用活动作为我活动的基类。
I've created some composie UIs in my android apps and there are some ListView controls -among other controls- inside a view. Because of this, I have used "Activity" as my activity base class.
现在我需要显示一个简单的信息,如无项目时,绑定到我的适配器ListView控件是空的。我知道这是可能使用ListActivity的时候,但我不知道什么是最好的办法了吗?
Now I need to display a simple message like "No Item" when the ListView that is bound to my adapter is empty. I know this is possible when using ListActivity but I'm not sure what's the best approach for this?
您正在寻找一个ListActivity的空观点:
You're looking for the empty view of a ListActivity:
http://developer.android.com/reference/android/app/ListActivity.html
如果您正在使用ListView控件,您可以使用的方法setEmptyView():
If you're using ListView you can use the method setEmptyView():
http://developer.android.com/reference/android/widget/AdapterView.html#setEmptyView(android.view.View)
上一篇:为什么亚洲开发银行的回报离线设备字符串后面呢?离线、亚洲、字符串、开发银行
下一篇:INSTALL_FAILED_CPU_ABI_INCOMPATIBLE使用设备的IntelliJ设备、INSTALL_FAILED_CPU_ABI_INCOMPATIBLE、IntelliJ