title: Google Play says to sign into Google account (In-app billing)
body: <p>I've been trying to solve this problem for a week and I've no any success. The thing is that, I handle if the user of the app tries to buy subscription without being signed into Google account and I lead him to Google sign in screen, but even after user has signed in and tries to buy subscription Google play says he needs to sign into Google account. On this very step I've been debugging and AccountManager's getAccounts() returns array including account that has been recently added by the user. And only after I kill the app and launch it again, Google play sees user's Google account and purchase works fine. Any ideas how to fix this problem? 
  Here is the method which is called when the user clicks "Purchase" button:</p>
  
  <pre><code>accountsArray = accountManager.getAccountsByType("com.google");
     if(accountsArray != null &amp;&amp; accountsArray.length &gt;= 1){
         SystemUtils.getCache(this, new CacheUtils.CallBack&lt;Cache&gt;() {
             @Override
             public void run(Cache cache) {
                 billingActivityCache = cache;
             }
         });
  
         JSONObject payload = null;
         try {
             payload = new JSONObject()
                     .put("user", new JSONObject()
                             .put("id", billingActivityCache.getUser().getId()
                             ));
         } catch (JSONException e) {
             e.printStackTrace();
         }
  
         Bundle buyIntentBundle = null;
         try {
             buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
                     currentSku, "subs", payload.toString());
         } catch (RemoteException e) {
             e.printStackTrace();
         }
  
         PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
         try {
             startIntentSenderForResult(pendingIntent.getIntentSender(),
                     BUY_KEY, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
                     Integer.valueOf(0));
         } catch (IntentSender.SendIntentException e) {
             e.printStackTrace();
         }
     } else{
         Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
         intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[]{"com.google"});
         startActivityForResult(intent, LOGIN_GOOGLE);
     }
  </code></pre>