Skip to Main Content
50 Android Hacks
book

50 Android Hacks

by Carlos Sessa
June 2013
Intermediate to advanced content levelIntermediate to advanced
216 pages
6h 3m
English
Manning Publications
Content preview from 50 Android Hacks

Chapter 6. Working with lists and adapters

Lists and adapters are two of the main concepts to master in Android development. In this chapter, you’ll learn several tips and tricks you can use with lists and adapters.

Hack 24 Handling empty lists: Android v1.6+

A common way to show data to the user in mobile platforms is to place it inside a list. When you do this, you need to handle two cases: the ordinary list full of items and an empty state. For the list, you’ll use a ListView, but how do you handle the empty state? Fortunately, there’s an easy way to achieve this. Let’s look at how to do it.

ListView and other classes that extend AdapterView easily handle emptiness through a method called setEmptyView(View). When the AdapterView needs ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android Security

Android Security

Anmol Misra, Abhishek Dubey

Publisher Resources

ISBN: 9781617290565Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link