MainActivity
(Figs. 4.18–4.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 be displayed. If the IDE recognizes the name, it will suggest the missing import
statement you need to add—simply click the name to add it.
28 public class MainActivity extends ListActivity
29 {