Multiple Google+ accounts on Android while messaging

I successfully applied Google+ in my Android app by following the Google guide at: https://developers.google.com/+/mobile/android/sign-in

The problem I am facing is that there are multiple accounts configured on my device, for example Account A and B. On the Google+ app, my phone is set up with Account A.

Now, when I click the "Login" button in my application, an account selection dialog box appears. I choose Account B. APp successfully logs in with this account, and I can get user information such as name, dp, etc.

But when I try to post to google +, a sharing dialog appears, and this is strange. Account A is installed on top. (Sharing also appears in the feed on account A, not B.)

I use the following code for sharing:

Intent shareIntent = new PlusShare.Builder(this) .setType("text/plain") .setText("Welcome to the Google+ platform.") .setContentUrl(Uri.parse("https://developers.google.com/+/")) .getIntent(); startActivityForResult(shareIntent, 0); 
+6
source share

Source: https://habr.com/ru/post/949400/


All Articles