使用FirebaseJobDispatcher

时间:2019-03-01 16:27:16

标签: android firebase-job-dispatcher

我正在尝试第一次使用FirebaseJobDispatcher,并且从示例中获得了以下代码。

            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);

但是,Android Studio在以下消息中加了下划线

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)

我看了几个例子,它们都是这样。我在做什么错了?

0 个答案:

没有答案