In RoboGuice examples there are two different ways to inject something
@Inject
protected LayoutInflater inflater;
@Inject
protected Provider<LayoutInflater> inflater2;
What’s the difference between them and what way and when i need to choose?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need provider to inject several instances of smth. For example, a row for an each user’s action. Direct inject is used when you know what you want and size of your desires.
Provider is a fabric, that injected in you code