Android Open Source - NASAImageOfTheDay Background Task






From Project

Back to project page NASAImageOfTheDay.

License

The source code is released under:

MIT License

If you think the Android project NASAImageOfTheDay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.parser;
//from  w  w  w .  ja  va2s.  c om
import java.util.ArrayList;

import android.os.AsyncTask;
import android.util.Log;

public class BackgroundTask extends AsyncTask<Void, Void, ArrayList<ApodFeedItem>> {
  
  public ReturnFromBackgroundTask deligate = null;
  
  
  String murl;
  public BackgroundTask(String mURL) {
    murl = mURL;
  }
  
   
  
  @Override
  protected ArrayList<ApodFeedItem> doInBackground(Void... params) {
     IotdHandler handler = new IotdHandler(murl);
       handler.processFeeds();
       ArrayList<ApodFeedItem>feedItemList = handler.getFeedItemList();
      for (int i = 0; i < feedItemList.size(); i++) {
      Log.d("Rahool", ((ApodFeedItem)feedItemList.get(i)).toString() );
    }
    return feedItemList;
  }
  @Override
  protected void onPostExecute(ArrayList<ApodFeedItem> result) {
    super.onPostExecute(result);
    deligate.responseFromBackground(result);
    //Log.d("Rahoool",result.toString());
  }
  
  
}




Java Source Code List

com.example.nasaproject.MainActivity.java
com.example.parser.ApodFeedItem.java
com.example.parser.BackgroundTask.java
com.example.parser.GetImageInBackground.java
com.example.parser.IotdHandler.java
com.example.parser.ReturnFromBackgroundTask.java