4.5.2. Extending ListActivity

MainActivity (Figs. 4.184.27) is the Twitter Searches app’s only Activity class. When you created the TwitterSearches project, the IDE generated MainActivity as a subclass of Activity and provided the shell of an overridden onCreate method, which every Activity subclass must override. We changed the superclass to ListActivity (Fig. 4.18, line 28). When you make this change, the IDE does not recognize class ListActivity, so you must update your import statements. In the IDE, you can use Source > Organize Imports to update the import statements. Eclipse underlines any class or interface name that it does not recognize. In this case, if you hover the mouse over the class or interface name, a list of quick fixes will ...

Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.