{"action":"opened","issue":{"url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/35","labels_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/35/comments","events_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/35/events","html_url":"https://github.com/yigit/android-priority-jobqueue/issues/35","id":96785748,"number":35,"title":"onRun not called because of a declared function ?!","user":{"login":"AndroidDeveloperLB","id":5357526,"avatar_url":"https://avatars.githubusercontent.com/u/5357526?v=3","gravatar_id":"","url":"https://api.github.com/users/AndroidDeveloperLB","html_url":"https://github.com/AndroidDeveloperLB","followers_url":"https://api.github.com/users/AndroidDeveloperLB/followers","following_url":"https://api.github.com/users/AndroidDeveloperLB/following{/other_user}","gists_url":"https://api.github.com/users/AndroidDeveloperLB/gists{/gist_id}","starred_url":"https://api.github.com/users/AndroidDeveloperLB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndroidDeveloperLB/subscriptions","organizations_url":"https://api.github.com/users/AndroidDeveloperLB/orgs","repos_url":"https://api.github.com/users/AndroidDeveloperLB/repos","events_url":"https://api.github.com/users/AndroidDeveloperLB/events{/privacy}","received_events_url":"https://api.github.com/users/AndroidDeveloperLB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-23T10:50:34Z","updated_at":"2015-07-23T10:50:34Z","closed_at":null,"body":"I have created a class that extends Job, and it has this function:\r\n\r\n   protected JobInfo.Builder prepareLollipopJobBuilder(final Context context) {\r\n        //some code here, but even without anything it's ok for this check\r\n        return null;\r\n    }\r\n\r\nWhen I create the job and schedule it, it calls \"onAdded\", but it never calls \"onRun\".\r\nI've searched in the other posts, and the only thing I've found is this:\r\nhttps://github.com/yigit/android-priority-jobqueue/issues/6\r\nBut here I don't even have a special CTOR or special fields. Only a function. \r\n\r\nIt happens even if I have the function in a class that extends from the base-job-class that extends the Job class. \r\n\r\nHow could it be?\r\n\r\nTo test, here's a larger piece of code:\r\n\r\npublic class PostTweetJob extends Job {\r\n        public static final int PRIORITY = 1;\r\n    \r\n        public PostTweetJob(String text) {\r\n            super(new Params(PRIORITY).requireNetwork().persist());\r\n        }\r\n    \r\n        protected JobInfo.Builder prepareLollipopJobBuilder(final Context context) {\r\n            return null;\r\n        }\r\n    \r\n        @Override\r\n        public void onAdded() {\r\n            Log.d(\"AppLog\", \"onAdded\");\r\n        }\r\n    \r\n        @Override\r\n        public void onRun() throws Throwable {\r\n            Log.d(\"AppLog\", \"onRun\");\r\n        }\r\n    \r\n        @Override\r\n        protected RetryConstraint shouldReRunOnThrowable(Throwable throwable, int runCount,\r\n                                                         int maxRunCount) {\r\n            return RetryConstraint.createExponentialBackoff(runCount, 1000);\r\n        }\r\n    \r\n        @Override\r\n        protected void onCancel() {\r\n        }\r\n    }\r\n\r\nAnd how to call it in the MainActivity :\r\n\r\n        final JobManager jobManager = new JobManager(this, new Configuration.Builder(this).build());\r\n        jobManager.addJobInBackground(new PostTweetJob(\"ASD\"));"}}