#pragma mark equivalent in Android Studio

Solution 1:

In Android Studio you can add regions using the steps below

  1. Open the IDE you are using
  2. Select the code you want to group
  3. Press Ctrl + Alt + T (Cmd + Opt + T for mac) and select the “region .. end region comments”
  4. Now the code is surrounded with “//region” / “//endregion” lines, you can see that the region can be fold-able
  5. You can now edit the description of your group
  6. You can easily see the code within your group without having to expand the group, just hover the group description with the mouse pointer

See this

Solution 2:

Meet custom folding regions, the IntelliJ IDEA (where Android Studio is derived from) way to customized code structure support (that is what jump bar serves in Xcode).

Keyboard shortcut ⌥⌘T or manual typing,

// region REGION_NAME
// YOUR CODE HERE
// endregion

Here is the missing gif demo (that people want in their official doc) showing how Android Studio behaves when two customized regions are added.

demo

Official Documentation

https://www.jetbrains.com/help/idea/code-folding-settings.html

Solution 3:

No idea why answers by Android Developers mostly lacking clarity. Here is my contribution.

Simply said, just wrap the codes with

//region SECTION NAME
...
//endregion

enter image description here