在尝试使用.state 'opportunity.new.connections',
url: '/connections/:connectionType'
params:
opportunityId: null
opportunity: null
connectionType: null
activeDropDown: null
template: '<opp-profile-custom-object-connection
connections="connections"
custom-object-type="customObjectType"
custom-connection-types="customConnectionTypes"
custom-object="customObject"
></opp-profile-custom-object-connection>'
controller: ['$scope', 'connections', 'customObjectType', 'customConnectionTypes', 'customObject',
($scope, connections, customObjectType, customConnectionTypes, customObject) ->
$scope.connections = connections
$scope.customObjectType = customObjectType
$scope.customConnectionTypes = customConnectionTypes
$scope.customObject = customObject
]
resolve:
connections: ['clickConnections', '$stateParams', (clickConnections, $stateParams) ->
opportunity =
id: $stateParams.opportunityId
clickConnections.getConnectionsByOpportunityAndType(opportunity, $stateParams.connectionType).then (response) ->
response
.catch ->
$state.go 'notFound'
]
customObjectType: ['$stateParams', 'clickApi', '$q', '$state', ($stateParams, clickApi, $q, $state) ->
clickApi.getData '/custom-object-types', null, { query: 'canonicalPlural="' + $stateParams.connectionType + '"' }
.then (response) ->
response.data._embedded.customObjectTypes[0]
.catch ->
$state.go 'notFound'
]
customConnectionTypes: ['$stateParams', 'customConnectionTypeService', 'CONNECTION_TYPE_OPPORTUNITY', 'customObjectType', ($stateParams, customConnectionTypeService, CONNECTION_TYPE_OPPORTUNITY, customObjectType) ->
customConnectionTypeService.getCustomConnectionTypesByFromAndToCategory(CONNECTION_TYPE_OPPORTUNITY, 'object' + customObjectType.id)
]
customObject: ['clickCustomObjects', 'customObjectType', (clickCustomObjects, customObjectType) ->
clickCustomObjects.getSelect2AjaxConfig
multiple: false
newable: ['customObject']
customObjectTypeId: customObjectType.id
]
activeDropDown: ['$stateParams', 'profileTabService', 'customObjectType', ($stateParams, profileTabService, customObjectType) ->
if $stateParams.activeDropDown then return $stateParams.activeDropDown
profileTabService.getLastAccessedConnectionType('opportunities', "object#{customObjectType.id}", null).then (selection) ->
$stateParams.activeDropDown = selection || 'standard'
]
安排作业时,似乎经常发生以下错误,但该作业无法启动:
JobScheduler
我用于在活动2018-11-16 08:59:58.740 912-4220/? E/JobScheduler: jobid:20536
java.lang.IllegalStateException: Same jobid in systemuid.
at com.android.server.job.JobSchedulerService.scheduleAsPackage(JobSchedulerService.java:888)
at com.android.server.job.JobSchedulerService$JobSchedulerStub.schedule(JobSchedulerService.java:2592)
at android.app.JobSchedulerImpl.schedule(JobSchedulerImpl.java:44)
at com.android.server.backup.FullBackupJob.schedule(FullBackupJob.java:54)
at com.android.server.backup.BackupManagerService$3.run(BackupManagerService.java:1925)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
中安排作业的代码如下:
onCreate()
什么可能导致此错误?我将哪个ID传递给JobScheduler js = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
js.schedule(new JobInfo.Builder(123, new ComponentName(this, TestService.class))
.setMinimumLatency(5000)
.build());
构造函数似乎并不重要-堆栈跟踪中提到的20536始终相同。