question

Bryanne Vega avatar image
Bryanne Vega asked ·

Intents -> LineItem Removed

Is there such an intent?

Orders
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Jeffrey Blattman avatar image
Jeffrey Blattman answered ·

There is not. There is a listener interface for that (IOnOrderUpdatedListener2). If you want to perpetually listen for all line item changes that is going to be hard to achieve since Android won't necessarily keep your app in memory / listener registered. The best you can do is create a foreground service, but even then it's not guaranteed. That's not really great either though since it means your app needs to sit in memory in perpetuity consuming resources.

You might consider a different approach... e.g. waking up periodically to examine state and take action. This is the approved way. See Android's documentation for WorkManager.

1 comment Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yet there is a broadcast for "line item added". It works perfectly and better than the onLineItemAdded from the listener (on my implementation, onLineItemAdded gets called 2-5 times for a single added line item).

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community