Given:

  1. Two Activity A and B ; B starts from A , to A we return from B
  2. In each activity on the fragment C. The fragment is the same in each activity.
  3. Fragments use the same RoboSpice service for RoboSpice Internet. Run it on onStart and stop on onStop

Problem:

When switching from one activation to another, the activated activation starts first and then the old one stops. Service service stops and its result is lost.

Possible solutions:

  1. Create different services for different activites.
  2. Check in onStop that we launched another activation, and not nailed by the system / are minimized by setting the flag in the activation, from which we launch another.

Question:

Both options invented by me are puffing on crutches . How better to do in this situation?

    0