3

I got this warning in my project. I'm learning to use IntelliJ IDEA as my IDE.

Here's the code with warnings:

@InjectView(R.id.button)
private Button loginBtn;

The full messages are as follows:

Binding annotation @InjectView(R.id.button) without @Inject declared less... (Ctrl+F1)

This inspection reports binding annotations on fields or parameters without a matching @Inject annotation.

Such annotations will be ignored by Guice. Powered by GuiceyIDEA

I can't understand what it want me to do.

I add a @Inject annotation on the field and the warning did disappear, but the app doesn't work.

So how should I do to fix the warning?

Thanks.

GabrielOshiro
  • 7,986
  • 4
  • 45
  • 57
Kimi Chiu
  • 2,103
  • 3
  • 22
  • 37

1 Answers1

2

we are using android studio since few months but I had never faced this type of issue..

But please make sure if you are using butterknife in android activity then use

@InjectView(R.id.button)
private Button loginBtn;

do not forgot to call this

ButterKnife.inject(this);  

after setContentView in Activity class

Hope it helps you !!