Code example for AsyncTaskLoader

0
 
  private Account account;
  private Context context;
 
  public PlaylistLoader(Context context, Account account){
    super(context);
    this.account = account;
    this.context = context;
  } 
 
  public PlaylistResult loadInBackground(){ 
    return attemptLoad(true); 
  } 
 
  private PlaylistResult attemptLoad(boolean attemptReauth){
    AccountManager am = AccountManager.get(getContext());
    String authToken = "";
    try{ 
      authToken = am.blockingGetAuthToken(account, "", true);
    }