I am using Hilt and am trying to inject my Application into another activity:
@HiltAndroidApp
public class MyApplication extends Application {
...
}
@AndroidEntryPoint
public class MyActivity extends AppCompatActivity {
@Inject
protected MyApplication application;
...
}
I am getting the following error:
error: [Dagger/MissingBinding] com.test.MyApplication cannot be provided without an @Inject constructor or an @Provides-annotated method.
I think I can write a provider for MyApplication, but I thought Hilt by default already does that. Assuming that I could inject the base "Application" class, but I would like to get my overridden application class. Without of course casting it every time I want to use it.