58

How does one who is using IntelliJ or Android Studio extract a public static inner class to create a new top level class?

Thank you.

1
  • Excuse the wordiness. The question was too short initially. Basically: How do I extract a public static inner class to create a new top level class in IntelliJ? Commented Aug 31, 2015 at 17:34

1 Answer 1

112

Select the class name.

Refactor > Move or press F6

Select "Move inner class Foo to upper level"

Sign up to request clarification or add additional context in comments.

3 Comments

Is there a way to move all inner classes at once?
Not to my knowledge.
One thing to note: this has to be done from the code editor window. It doesn't work if you select the nested class in the Structure view and refactor from there (2016.3.4).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.