IntelliJ IDEA 2016.1 Help

New Android Component Dialog

Project Tool Window | context menu of a package with the application classes | New - Android Component

In this dialog box, specify the class that implements the new Android component, the component type, and the title to be displayed to the user.

Name In this text box, type the name of the class that implements the component.
Kind In this drop-down list, specify the component type. The available options are:
  • Activity: implements a window where you place your UI to interact with the user.
  • Fragment: represents a behavior or a part of user interface in an activity.
  • Application: an Android package, i.e. an .apk archive that contains the contents of an Android app and the installer.
  • Service: represents an application's desire either to perform an operation without interacting with the user, or to supply functionality for other applications.
  • Broadcast Receiver enables the reception of intents from the system or another application without running other components of this application.
  • Remote Interface: an Android Interface Definition Language (AIDL) interface used for interprocess communication.
Label In this text box, type the title that will be displayed to the user.
Mark as startup Activity Select this check box to have the new component of the Activity type displayed by default when the application starts.
Create layout file
  • Select this check box to have IntelliJ IDEA generate a stub of the related layout definition file, that is, the content view of the new activity or fragment. In the Create Layout dialog box that opens, specify the layout name, its root element, and the folder where the layout definition will be stored relative to the res folder.
    • If your application does not need to be compatible with various Android devices and, therefore, no multiple screens support is required, accept the default layout subfolder.
    • To provide alternative resources, specify the resource qualifiers that determine a specific device configuration. Move the relevant qualifiers from the Available qualifiers list to the Chosen qualifiers list and specify their values. IntelliJ IDEA appends all the selected qualifiers to the Directory name field with a dash character as separator.

    For details, see Creating Resources.

  • If the check box is cleared, you will have to create a content view of the new activity or fragment manually.

See Also

Last modified: 13 July 2016