I would proceed this way:
Show a notification indicating that there is a problem doing task X (actually, interacting with Google Play Services, but you may say something else more specific to your app).
For this notification, provide a
PendingIntent
that starts your activity. As part of the extras for this PendingIntent, pass the PendingIntent provided byConnectionResult.getResolution()
. PendingIntents are parcelable so this shouldn't pose a problem.In
onCreate()
for this Activity, obtain the originalPendingIntent
from the extras, then callstartIntentSenderForResult()
with it. This will automatically redirect the user to wherever Google Play Services needed him to go (possibly log-in?)Then, in
onActivityResult()
, finish the activity, having first notified your service (via an Intent) that the problem is resolved (or not). The transient activity will have been invisible to the user.
I admit this solution is theoretical, but it should work.