title: Access youtube account with accountmanager
body: <p>Im trying to access youtube account with account manager, meaning i want to access youtube with a account linked to my device and with this get youtube token to access user playlist and whatever. Freedi application for android doing somthing like this.</p>
  
  <p>I used this code to get token </p>
  
  <pre><code>    am.getAuthToken(accounts[0], "youtube", true, new AccountManagerCallback&lt;Bundle&gt;() {
  
          @Override
          public void run(AccountManagerFuture&lt;Bundle&gt; future) {
              try {
                  Bundle bundle = future.getResult();
                  if (bundle.containsKey(AccountManager.KEY_INTENT)) {
                      Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT);
                      intent.setFlags(intent.getFlags() &amp; ~Intent.FLAG_ACTIVITY_NEW_TASK);
                      startActivityForResult(intent, 0);
                  } else if (bundle.containsKey(AccountManager.KEY_AUTHTOKEN)) {
                      my_access_token = bundle.getString(AccountManager.KEY_AUTHTOKEN);
                      onActivityResult(0,1,null);
                  }
              } catch (Exception e) {
                  Log.e("TEST", e.getMessage(), e);
              }
          }
      }, null);
  </code></pre>
  
  <p>but the var my_access_token filled with token that youtube not recognize...
  how can i get youtube token from it? and how to get the user playlist?</p>