But what if the active activity changes all the time? Do I have to shut down and re-initialize the billing all the time?
There is nothing bad in it. Connecting to a service is very fast. Most important is to be able to handle onActivityResult() callback when activity starts again.
How would I handle such a thing most elegantly?
I'm not sure which kind of application you write. If it's a game, then most likely it consists of a single activity and there is no problem anyway. If it is other kind of application with multiple activities, then in my opinion, it's a good idea to have a single activity, where user is able to see all the in-app products (bought and to buy). This is like an "internal store" activity. This activity can connect to the billing service. Other activities should forward to "internal store" where user can read more about an in-app product and decide to buy it. I find it very convenient.
Another approach would be to implement you billing logic in a Fragment which can be reused in every activity. You just need to override onActivityResult()
and forward result to that Fragment. This is how I implemented it in my app.
Hope this helps.