LarsH
LarsH

Reputation: 27994

How can I see what method I'm in, in Android Studio?

It used to be (up through Android Studio 4.1, IIRC) that when editing a file, you could see the name of the method (and/or class, etc.) that the cursor is in, displayed in the status bar near the line / column number. This was very helpful when the beginning of the method was away off the top of the screen somewhere, so that you didn't have to scroll up a page or two to find it, lose your place, and then scroll back down.

Now, in Android Studio 4.2, I don't see this. I still see the column / line number in the status bar (displayed in the lower right), and if you right click there, you can toggle the display of several items. But the name of the current method isn't one of the options.

I've tried the Structure pane, and while it does list the methods in the class I'm editing, it doesn't indicate the current method. (Nor do I want to allocate so much real estate just to see a method name, if I don't have to.)

I also tried searching Android Studio help, to no avail. Has this feature disappeared? If not, where can I find it again?

Upvotes: 10

Views: 1270

Answers (2)

LarsH
LarsH

Reputation: 27994

I found it. There's a navigation bar near the top of the screen (see #2 in the diagram here) that shows the current context, down to the current method or whatever the cursor is in. Maybe this moved from the bottom part of the screen, I don't know.

Update: In Koala, there are also some "frozen" lines at the top of the edit window that show what class and method(s) you're in: Frozen lines in edit window

Upvotes: 2

user1123432
user1123432

Reputation: 432

Showing current place in code can be achieved using navigation bar or breadcrumbs.

To turn on breacrumbs go to Android Studio Settings / Editor / General / Breadcrumbs. Make sure this feature is activated for your programming language.

breadcrumbs setting

breacrumbs

Upvotes: 13

Related Questions