0

I'm trying to use the FirebaseJobDispatcher for the first time and I got the code below from an example.

            FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(this));
            Job job = FirebaseJobDispatcher.newJobBuilder()
                    .setTag("testing job")
                    .setService(SmsDeleterJobService.class)
                    .setReplaceCurrent(true)
                    .setConstraints(Constraint.ON_ANY_NETWORK)
                    .build();

            dispatcher.mustSchedule(job);

However Android studio has it underlined with the following message

Variable 'dispatcher' initializer 'new FirebaseJobDispatcher(new GooglePlayDriver(this))' is redundant less... (Ctrl+F1) 
Inspection info: This inspection points out the cases where a variable value is never used after its assignment, i.e.:  - the variable never gets read after assignment OR
  - the value is always overwritten with another assignment before the next variable read OR  - the variable initializer is redundant (for one of the above two reasons)

I looked at a few examples and they were all like this. What am I doing wrong?

Mikev
  • 2,012
  • 1
  • 15
  • 27
Arya
  • 8,473
  • 27
  • 105
  • 175
  • `FirebaseJobDispatcher` is no longer being supported and you should move to `WorkManager` – tyczj Mar 01 '19 at 16:31
  • @tyczj unfortunately all the examples I'm finding are in Kotlin. Do you know any in Java? – Arya Mar 01 '19 at 17:06
  • Just look at the docs https://developer.android.com/topic/libraries/architecture/workmanager – tyczj Mar 01 '19 at 17:09

0 Answers0