@Module
*public abstract class *AppModule {



*//    @ContributesAndroidInjector(modules = SharedPreferencesModule.class)//   
 abstract SecondActivity secondActivity();   *@Binds
    *abstract *Context getContext(Application application);
   @Binds
    *abstract *SharedPreferences sharedPreferences(Context context);


}
@Singleton
@Component(modules = AppModule.*class*)
*public interface *AppComponent {
    *void *inject(Activity mainActivity);
    Context getContext();
    SharedPreferences getSharedPreferences();


    @Component.Builder
    *interface *Builder{
        AppComponent build();
        @BindsInstance Builder application(Application application);
    }
}



Error:(24, 32) error: @Binds <http://twitter.com/Binds> methods must have only 
one parameter whose type is assignable to the return type
What does this error mean? I dont understand a thing . Where is the 
implementation of the getContext() abstract method to be provided?
According to studio,that method is unused.
Please help,this is getting extremely complicated and confusing.
This is this medium article:
https://proandroiddev.com/dagger-2-component-builder-1f2b91237856

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9731712e-c4ea-41f4-b0fe-bbf85fa80bfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to