Translations:Android Training/Starting Another Activity/6/en

Aus Android Wiki
Wechseln zu: Navigation, Suche

Note: The reference to DisplayMessageActivity will raise an error if you’re using an IDE such as Android Studio because the class doesn’t exist yet. Ignore the error for now; you’ll create the class soon. The constructor used here takes two parameters:

    • Context as its first parameter (this is used because the Activity class is a subclass of Context)
    • The Class of the app component to which the system should deliver the Intent (in this case, the activity that should be started) Android Studio indicates that you must import the Intent class.
  1. At the top of the file, import the Intent class: