71

I keep getting annoyed by the "Can be private" warning, however my FirebaseRecyclerAdapter will not work in that case. So, is there a @SuppressWarnings for that?

What I've tried:

@SuppressWarnings("all") but that's not what I want.

Note: I am using Android Studio

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117

1 Answers1

124

It is best to simply disable this inspection, either for your whole project or for a specific class. Put your cursor on the warning and press Alt + Enter to bring up the following menu, which allows you to disable it:

Disable inspection

If you really want to use @SuppressWarnings you can choose the Suppress for class option from the dialog above. This will add the following annotation:

@SuppressWarnings("WeakerAccess")
Aerus
  • 4,332
  • 5
  • 43
  • 62
  • 3
    I am using IntelliJ 2017.1, but while the first lightbulb menu appears, I don't get the popout where I can `suppress for class`, etc. When clicking `Make 'package-private'` it immediately refactors. – Arnold Schrijver Jun 25 '18 at 13:20
  • @ArnoldSchrijver click the arrow instead of the option, or use your navigation buttons to navigate to the menu – smac89 Aug 20 '19 at 20:41