| | |
| | | package cn.flightfeather.thirdapp.task; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.os.Environment; |
| | | import android.util.Log; |
| | | import android.widget.ImageView; |
| | |
| | | private Activity activity; |
| | | |
| | | //下载并显示图片 |
| | | public DownloadAndSetImageTask(Mediafile mediafile, ImageView imageView, Context context) { |
| | | public DownloadAndSetImageTask(Mediafile mediafile, ImageView imageView, Activity activity) { |
| | | this.mediafile = mediafile; |
| | | this.imageView = imageView; |
| | | application = (CommonApplication) context.getApplicationContext(); |
| | | this.activity = activity; |
| | | application = (CommonApplication) activity.getApplicationContext(); |
| | | } |
| | | //只下载 |
| | | public DownloadAndSetImageTask(Mediafile mediafile, Context context) { |
| | | public DownloadAndSetImageTask(Mediafile mediafile, Activity activity) { |
| | | this.mediafile = mediafile; |
| | | application = (CommonApplication) context.getApplicationContext(); |
| | | application = (CommonApplication) activity.getApplicationContext(); |
| | | try { |
| | | activity = (Activity) context; |
| | | this.activity = (Activity) activity; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |