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 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   {


Fig. 4.18 | Class MainActivity is a subclass of ListActivity.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.238.159