本文整理汇总了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;
}
示例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?"*/
}
示例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?"
}
示例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
}
示例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;
}