Code example for AsyncTaskLoader

	String mUsername;
	String mPassword;
	public LoginLoader(Context context, String username, String password) {
		mUsername = username;
		mPassword = password;
	public Result loadInBackground() {
		if (mUsername == null || mPassword == null) return Result.EMPTY;
		String newCookie = LoginManager.login(mUsername, mPassword);
		boolean isSuccess = newCookie != null;
		if (isSuccess) {
			// saves new user cookie and updates the timestamp 
			UserPrefs prefs = new UserPrefs(getContext());
Connect your IDE to all the code out there  Get Codota for Java