How to use static import in Android Studio

I want to declare static import in Android Studio as follows:

 import static com.example.constants.Preferences.*;

but as soon as I move to the next line, Android Studio will hide it like this:

import com.example.constants.*;

How to get Android Studio to let me decide how to import stuff?

+4
source share
1 answer

Intellij shares static import by default. Go to "Settings" → "Editor" → "Code Style" → "Java" → "Import" and "Cancel Static Import of Layouts Separately." This can help...

+1
source

Source: https://habr.com/ru/post/1598571/


All Articles