4.5.1. package and import Statements

Figure 4.17 shows the app’s package and import statements. The package statement (inserted in line 4 by the IDE when you created the project) indicates that the class in this file is part of the com.deitel.twittersearches package. Lines 6–26 import the classes and interfaces the app uses.

Lines 6–7 import the ArrayList and Collections classes from the java.util package. We use class ArrayList to maintain the list of tags for the saved searches, and class Collections to sort the tags so they appear in alphabetical order. Of the remaining import statements, we consider only those for the features introduced in this chapter:

• Class AlertDialog of package android.app (line 9) is used to display dialogs.

• Class ...

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.