1

I have following issue when using IPC:

My activity binds to the service. When my activity is bound to service (very similar to http://www.survivingwithandroid.com/2014/01/android-bound-service-ipc-with-messenger-2.html ) i am facing the following issue:

· Normally everything works well and messages work fine in the two directions · However after some kills of the activity all messages going from the service to the activity are being corrupted (msg.what becomes 0 and any data bundle attached in the message is lost) · The number of kills to reproduce the issue depends on used phone, on a feature phone like samsung galaxy Ace it seems easier to reproduce than in a newer phone.

Restarting the service and binding again the activity fixes completely the issue but why is caused? And how we can avoid entering this state?

Onik
  • 19,396
  • 14
  • 68
  • 91
user1734654
  • 103
  • 5
  • are your service and activity hosted by different processes? or they are in the same process of your app? – pskink Nov 14 '16 at 09:32
  • hi,service and activty are using different processes within the same app. – user1734654 Nov 14 '16 at 09:50
  • any good reason for a different process? it makes only problems... – pskink Nov 14 '16 at 11:31
  • we want service is not bound to the activity as it should be alive (sending some TCP Traffic) even if activity gets killed by the system. We think most easy way to achieve this is to run service in a different process. Which type of problems are you referring? – user1734654 Nov 14 '16 at 15:02
  • swiping your app off from "recent apps screen" kills all of your processes, so adding `android:process=":myDifferentRemoteProcess"` will not help – pskink Nov 14 '16 at 15:22

0 Answers0