Translations:Android Training/Starting Another Activity/6/en: Unterschied zwischen den Versionen

Aus Android Wiki
(Neue Version von externer Quelle importiert)
 
(kein Unterschied)

Aktuelle Version vom 20. Dezember 2015, 21:22 Uhr

Nachricht im Original (Android Training/Starting Another Activity)
'''Note:''' The reference to <code>DisplayMessageActivity</code> 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:
#* A <code>Context</code> as its first parameter (<code>this</code> is used because the <code>Activity</code> class is a subclass of <code>Context</code>)
#* The <code>Class</code> of the app component to which the system should deliver the <code>Intent</code> (in this case, the activity that should be started) Android Studio indicates that you must import the <code>Intent</code> class.
# At the top of the file, import the <code>Intent</code> class:

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: