@@ -0,0 +1,1528 @@
+package in.jatindhankhar.shorl.network;%0A%0Aimport android.accounts.Account;%0Aimport android.content.Context;%0Aimport android.os.AsyncTask;%0Aimport android.util.Log;%0A%0Aimport com.google.android.gms.auth.GoogleAuthException;%0Aimport com.google.android.gms.auth.GoogleAuthUtil;%0Aimport com.google.android.gms.auth.UserRecoverableAuthException;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by jatin on 12/12/16.%0A */%0A%0Apublic class GetToken extends AsyncTask%3CVoid,Void,String%3E %7B%0A%0A    private static final String TAG =  GetToken.class.getSimpleName();%0A    private Context mAppContext;%0A    private Account mAccountName;%0A    private String AUTH_TOKEN_TYPE;%0A%0A    public GetToken(Context mAppContext,Account mAccountName,String AUTH_TOKEN_TYPE)%0A    %7B%0A        this.mAppContext = mAppContext;%0A        this.mAccountName = mAccountName;%0A        this.AUTH_TOKEN_TYPE = AUTH_TOKEN_TYPE;%0A    %7D%0A    @Override%0A    protected String doInBackground(Void... params) %7B%0A     try %7B%0A            if(isCancelled())%0A            %7B%0A                Log.d(TAG,%22doInBackground: task cancelled, so giving up on auth.%22);%0A                return null;%0A            %7D%0A         final String token = GoogleAuthUtil.getToken(mAppContext, mAccountName, AUTH_TOKEN_TYPE);%0A         Log.d(TAG,%22So token is %22 + token);%0A         return token;%0A     %7D catch (UserRecoverableAuthException e) %7B%0A         e.printStackTrace();%0A     %7D catch (GoogleAuthException e) %7B%0A         e.printStackTrace();%0A     %7D catch (IOException e) %7B%0A         e.printStackTrace();%0A     %7D%0A        return null;%0A    %7D%0A%7D%0A

Add asynctask for GetToken