package fishrungames.bashgid.core;


import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import fishrungames.bashgid.BashgidApplication;
import fishrungames.bashgid.MainActivity;
import fishrungames.bashgid.core.JournalManager.JournalSemiFullData;
import fishrungames.networkutils.SimpleAsyncTask;

public class NewsDownloadTask extends SimpleAsyncTask
{
	

	protected Long doInBackground(Bundle... queryArr)
	{
		
		for (int i = 0; i < NewsManager.urlArr.length; i++)
		{
			NewsManager.LoadNewsFromRss(NewsManager.urlArr[i], this);
		}
		
		
		return (long) 0;
	}

	protected void onProgressUpdate(Integer... progress)
	{
		Message completeMessage = BashgidApplication.mainHandler.obtainMessage(BashgidApplication.NEWS_DOWNLOADER_STATE_UPDATE, progress[0]);

		completeMessage.sendToTarget();

	}

	protected void onPostExecute(Long result)
	{
		Message completeMessage = BashgidApplication.mainHandler.obtainMessage(BashgidApplication.NEWS_DOWNLOADER_STATE_FINISHED, 100);

		completeMessage.sendToTarget();
	}
	

}
