Title: @EIntentService Document Improvement · Issue #1327 · androidannotations/androidannotations · GitHub
Open Graph Title: @EIntentService Document Improvement · Issue #1327 · androidannotations/androidannotations
X Title: @EIntentService Document Improvement · Issue #1327 · androidannotations/androidannotations
Description: Android requires that, when implementing of a IntentService, we create a default constructor that matches: public IntentService(String name) Without this constructor, AndroidAnnotation will throw an error while compiling. Error:(15, 8) G...
Open Graph Description: Android requires that, when implementing of a IntentService, we create a default constructor that matches: public IntentService(String name) Without this constructor, AndroidAnnotation will throw a...
X Description: Android requires that, when implementing of a IntentService, we create a default constructor that matches: public IntentService(String name) Without this constructor, AndroidAnnotation will throw a...
Opengraph URL: https://github.com/androidannotations/androidannotations/issues/1327
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@EIntentService Document Improvement","articleBody":"Android requires that, when implementing of a IntentService, we create a default constructor that matches:\n\n```\npublic IntentService(String name)\n```\n\nWithout this constructor, AndroidAnnotation will throw an error while compiling.\n\n```\nError:(15, 8) Gradle: error: constructor IntentService in class IntentService cannot be applied to given types;\nrequired: String\nfound: no arguments\nreason: actual and formal argument lists differ in length\n```\n\nCreating the constructor 'suggested' by AndroidStudio/Intellij, also doesn´t help:\n\n```\nError:(13, 14) Gradle: error: constructor MyIntentService in class MyIntentService cannot be applied to given types;\nrequired: String\nfound: no arguments\nreason: actual and formal argument lists differ in length\n```\n\nI think that the example @EIntentService documentation page should consider this issue. Something like this should solve the question:\n\n```\n@EIntentService \npublic class MyIntentService extends IntentService {\n\n //Constructor that matches IntentService´s default constructor\n public MyIntentService() {\n super(\"MyIntentService Name\");\n }\n\n @ServiceAction \n void mySimpleAction() { \n // ... \n } \n\n @ServiceAction \n void myAction(String param) {\n // ... \n } \n\n @Override \n protected void onHandleIntent(Intent intent) {\n // Do nothing here \n } \n\n} \n```\n\nAlso, the example that shows how to start the service should be:\n\n```\nMyIntentService_.intent(getApplication()) //\n .myAction(\"test\") // \n .start(); \n```\n","author":{"url":"https://github.com/regisoliveira","@type":"Person","name":"regisoliveira"},"datePublished":"2015-02-21T14:46:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1327/androidannotations/issues/1327"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3a1d998e-312b-b6f7-c75c-e6893bb1891d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B70A:3E91C2:629B0:88159:6A616604 |
| html-safe-nonce | bc523fdf6acf29bd543a15c0aab64566e3606e9208fe603a7240282e48452f2a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzBBOjNFOTFDMjo2MjlCMDo4ODE1OTo2QTYxNjYwNCIsInZpc2l0b3JfaWQiOiIyMjk0NjE1NTU4NDY0ODI0ODM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 73431ccce32165e9dfa472f10ee2ad787d94aadff7004afefd96349f55228bda |
| hovercard-subject-tag | issue:58461585 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/androidannotations/androidannotations/1327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbfae0264c729dc355be8e1edabba086ac3ef5a01f400e1493c2a33fcb20eae2/androidannotations/androidannotations/issues/1327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbfae0264c729dc355be8e1edabba086ac3ef5a01f400e1493c2a33fcb20eae2/androidannotations/androidannotations/issues/1327 |
| og:image:alt | Android requires that, when implementing of a IntentService, we create a default constructor that matches: public IntentService(String name) Without this constructor, AndroidAnnotation will throw a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | regisoliveira |
| hostname | github.com |
| expected-hostname | github.com |
| None | a69385f7d268ece7ad25b131bbd70f457024811fc79afcae43785a6849b724e2 |
| turbo-cache-control | no-preview |
| go-import | github.com/androidannotations/androidannotations git https://github.com/androidannotations/androidannotations.git |
| octolytics-dimension-user_id | 1315313 |
| octolytics-dimension-user_login | androidannotations |
| octolytics-dimension-repository_id | 3116751 |
| octolytics-dimension-repository_nwo | androidannotations/androidannotations |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3116751 |
| octolytics-dimension-repository_network_root_nwo | androidannotations/androidannotations |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 484cf265a1f970d5c7a5e7c37cb677d8010aa12f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width