Here is relevant bits of my code, any hints as to what could be the problem, appreciated:
public IBinder onBind(Intent intent) {
return null;
}
public void onCreate() {
Intent i = new Intent(this, TransactionHandling.class);
Notification notification = new Notification.Builder(this)
.setContentTitle("Loyalty").setContentText("Background Process Running")
.setSmallIcon(R.mipmap.ic_launcher).build();
startForeground(NOTIFICATION_ID, notification);
}
public int onStartCommand(Intent intent, int flags, int startId) {
orderConnectorA = new OrderV31Connector(getApplicationContext(), CloverAccount.getAccount(getApplicationContext()), null);
orderConnectorA.addOnOrderChangedListener(new OrderChangeListener());
orderConnectorA.connect();
Log.d("Order Handling", "Running");
mContext = getApplicationContext();
return START_STICKY;
}
public void onDestroy() {
orderConnectorA.disconnect();
orderConnectorA = null;
NotificationManager nMgr = (NotificationManager) this.getSystemService(this.NOTIFICATION_SERVICE);
nMgr.cancel(NOTIFICATION_ID);
}
private class OrderChangeListener implements OrderV31Connector.OnOrderUpdateListener2 {
@Overridepublic void onPaymentProcessed(String s, String s1) {
Log.d("OPP", s + " paymentid " + s1);
orderId = s;
paymentId = s1; //.................