{"action":"created","issue":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/70","labels_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/70/comments","events_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/70/events","html_url":"https://github.com/android10/Android-CleanArchitecture/issues/70","id":115839929,"number":70,"title":"How to inject an Activity from data package?","user":{"login":"MarcAragones","id":4242939,"avatar_url":"https://avatars.githubusercontent.com/u/4242939?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcAragones","html_url":"https://github.com/MarcAragones","followers_url":"https://api.github.com/users/MarcAragones/followers","following_url":"https://api.github.com/users/MarcAragones/following{/other_user}","gists_url":"https://api.github.com/users/MarcAragones/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcAragones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcAragones/subscriptions","organizations_url":"https://api.github.com/users/MarcAragones/orgs","repos_url":"https://api.github.com/users/MarcAragones/repos","events_url":"https://api.github.com/users/MarcAragones/events{/privacy}","received_events_url":"https://api.github.com/users/MarcAragones/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-09T09:40:23Z","updated_at":"2015-11-09T10:34:41Z","closed_at":null,"body":"Hello, I have a class with the following constructor in the data package:\r\n\r\n````java\r\n@Inject\r\npublic GcmManager(Activity activity) {\r\n    this.activity = activity;\r\n}\r\n````\r\n\r\nI thought it would work because of `ActivityModule` but I get the following error:\r\n\r\n````java\r\nError:(46, 20) error: android.app.Activity cannot be provided without an @Inject constructor or from an @Provides-annotated method.\r\n````\r\n\r\nI've tried to add a `providesActivity` method to the `ActivityModule` but it doesn't work either.\r\n\r\nAny idea of what should I do?"},"comment":{"url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/comments/155024204","html_url":"https://github.com/android10/Android-CleanArchitecture/issues/70#issuecomment-155024204","issue_url":"https://api.github.com/repos/android10/Android-CleanArchitecture/issues/70","id":155024204,"user":{"login":"MarcAragones","id":4242939,"avatar_url":"https://avatars.githubusercontent.com/u/4242939?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcAragones","html_url":"https://github.com/MarcAragones","followers_url":"https://api.github.com/users/MarcAragones/followers","following_url":"https://api.github.com/users/MarcAragones/following{/other_user}","gists_url":"https://api.github.com/users/MarcAragones/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcAragones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcAragones/subscriptions","organizations_url":"https://api.github.com/users/MarcAragones/orgs","repos_url":"https://api.github.com/users/MarcAragones/repos","events_url":"https://api.github.com/users/MarcAragones/events{/privacy}","received_events_url":"https://api.github.com/users/MarcAragones/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T10:34:41Z","updated_at":"2015-11-09T10:34:41Z","body":"Hi, @Trikke. I am following [this sample](https://github.com/googlesamples/google-services/tree/master/android/gcm/app/src/main/java/gcm/play/android/samples/com/gcmquickstart) about Google Cloud Messaging and I need and `Activity` in order to start a `RegistrationIntentService`. I was thinking of doing the GCM's token registration in the presentation layer but I don't know if that's okey."}}