当前位置: 首页>>代码示例>>Java>>正文


Java JobParameters.getExtras方法代码示例

本文整理汇总了Java中com.firebase.jobdispatcher.JobParameters.getExtras方法的典型用法代码示例。如果您正苦于以下问题:Java JobParameters.getExtras方法的具体用法?Java JobParameters.getExtras怎么用?Java JobParameters.getExtras使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.firebase.jobdispatcher.JobParameters的用法示例。


在下文中一共展示了JobParameters.getExtras方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onStartJob

import com.firebase.jobdispatcher.JobParameters; //导入方法依赖的package包/类
@Override
public boolean onStartJob(final JobParameters params) {
    Bundle bundle = params.getExtras();
    try {
        String messageKey = bundle.getString(MobiComKitConstants.AL_MESSAGE_KEY);
        if (!TextUtils.isEmpty(messageKey)) {
            Intent notificationIntentService = new Intent(PushNotificationJobService.this, NotificationIntentService.class);
            notificationIntentService.setAction(NotificationIntentService.ACTION_AL_NOTIFICATION);
            notificationIntentService.putExtra(MobiComKitConstants.AL_MESSAGE_KEY, messageKey);
            NotificationIntentService.enqueueWork(PushNotificationJobService.this, notificationIntentService);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    jobFinished(params, false);
    return false;
}
 
开发者ID:AppLozic,项目名称:Applozic-Android-Chat-Sample,代码行数:18,代码来源:PushNotificationJobService.java

示例2: onStartJob

import com.firebase.jobdispatcher.JobParameters; //导入方法依赖的package包/类
@Override
public boolean onStartJob(JobParameters jobParameters) {
    // Do some work here
    Log.i(TAG, "onStartJob " + jobParameters.getTag());

    if (SIGN_IN_SOCIAL_ACTION.equals(jobParameters.getTag())) {
        Bundle jobExtras = jobParameters.getExtras();
        ServiceManager.getInstance().login(QBProvider.FIREBASE_PHONE,
                jobExtras.getString(FirebaseAuthHelper.EXTRA_FIREBASE_ACCESS_TOKEN),
                App.getInstance().getAppSharedHelper().getFirebaseProjectId())
                .subscribe( new JobObserver(this, jobParameters));
        return true;
    }

    return false; // Answers the question: "Is there still work going on?"*/
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:17,代码来源:SessionJobService.java

示例3: onStartJob

import com.firebase.jobdispatcher.JobParameters; //导入方法依赖的package包/类
@Override
public boolean onStartJob(JobParameters job) {
	// Do some work here
	Utils.d("Job Started.");

	Bundle bundle = job.getExtras();
	Utils.d("Message: " + bundle.getString("message"));

	MessagingService.sendNotification(bundle, this);

	return true; // Answers the question: "Is there still work going on?"
}
 
开发者ID:FrogSquare,项目名称:GodotFireBase,代码行数:13,代码来源:NotifyInTime.java

示例4: onStartJob

import com.firebase.jobdispatcher.JobParameters; //导入方法依赖的package包/类
@Override public boolean onStartJob(JobParameters jobParameters) {
  Log.d(LOG_TAG, "onStartJob() called with: jobParameters = [" + jobParameters + "]");
  Bundle jobBundle = jobParameters.getExtras();
  if (jobBundle != null) {
    reactNativeEventStarter.trigger(jobBundle);
  } else {
    throw new RuntimeException("No job parameters provided for job:" + jobParameters.getTag());
  }
  return false; // No more work going on in this service
}
 
开发者ID:vikeri,项目名称:react-native-background-job,代码行数:11,代码来源:BackgroundJob.java

示例5: onStartJob

import com.firebase.jobdispatcher.JobParameters; //导入方法依赖的package包/类
@Override
    public boolean onStartJob(JobParameters jobParameters) {
        Log.d(LOG_TAG, "onStartCommand: begin");

        final Bundle mBundleExtras = jobParameters.getExtras();
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    DBAdapter dbAdapter = new DBAdapter(ToDoNotificationJob.this);
                    long mToDoID = -1;
                    long mCarID = -1;
                    if (mBundleExtras != null) {
                        mToDoID = mBundleExtras.getLong(TODO_ID_KEY, -1L);
                        mCarID = mBundleExtras.getLong(CAR_ID_KEY, -1L);
                    }
                    //@formatter:off
                String sql =
                " SELECT * " +
                " FROM " + DBAdapter.TABLE_NAME_TODO +
                " WHERE " + DB.sqlConcatTableColumn(DBAdapter.TABLE_NAME_TODO, DBAdapter.COL_NAME_TODO__ISDONE) + "='N' " +
                                " AND " + DB.sqlConcatTableColumn(DBAdapter.TABLE_NAME_TODO, DBAdapter.COL_NAME_GEN_ISACTIVE) + "='Y' ";
                if(mToDoID > 0)
                    sql = sql + " AND " + DB.sqlConcatTableColumn(DBAdapter.TABLE_NAME_TODO, DBAdapter.COL_NAME_GEN_ROWID) + " = " + mToDoID;
                if (mCarID > 0)
                    sql = sql + " AND " + DB.sqlConcatTableColumn(DBAdapter.TABLE_NAME_TODO, DBAdapter.COL_NAME_TODO__CAR_ID) + " = " + mCarID;
                //@formatter:on

                    Cursor toDoCursor = dbAdapter.execSelectSql(sql, null);
                    while (toDoCursor.moveToNext()) {
                        checkAndNotifyForToDo(toDoCursor, dbAdapter);
//                        Log.d(LOG_TAG, "onStartCommand: cursor move #" + toDoCursor.getPosition());
                    }
                    toDoCursor.close();
                    dbAdapter.close();
                }
                catch (Exception e) {
                    AndiCarNotification.showGeneralNotification(getApplicationContext(), AndiCarNotification.NOTIFICATION_TYPE_REPORTABLE_ERROR,
                            (int) System.currentTimeMillis(), getString(R.string.todo_alert_title), e.getMessage(), null, e);
                }
            }
        }).start();

        Log.d(LOG_TAG, "onStartCommand: end");
        jobFinished(jobParameters, false);
        return true;
    }
 
开发者ID:mkeresztes,项目名称:AndiCar,代码行数:48,代码来源:ToDoNotificationJob.java


注:本文中的com.firebase.jobdispatcher.JobParameters.getExtras方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。