Android Open Source - NASAImageOfTheDay Get Image In Background






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 ww w. j a  v  a 2s  .c o  m
import android.graphics.Bitmap;
import android.os.AsyncTask;

public class GetImageInBackground extends AsyncTask<String, Void, Bitmap> {
  
  String imageUrl;
  public ReturnFromBackgroundTask deligate = null;
  
  public GetImageInBackground(String mImageUrl) {
    imageUrl = mImageUrl;
  }

  @Override
  protected Bitmap doInBackground(String... params) {
    IotdHandler imageHandler = new IotdHandler();
    Bitmap image = imageHandler.getBitmap(imageUrl);
    
    return image;
  }
  @Override
  protected void onPostExecute(Bitmap result) {
    super.onPostExecute(result);
    deligate.responseImageFromBackground(result);
    
  }
}




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