package com.example.demo1;import java.io.File;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import com.tiffdecoder.TiffDecoder;import android.app.Activity;import android.graphics.Bitmap;import android.os.AsyncTask;import android.widget.ImageView;public class DownloadImagesTask extends AsyncTask
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build()); StrictMode.setVmPolicy( new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build()); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); ImageView image = (ImageView)this.findViewById(R.id.image); image.setTag("http://xibei1-image.xxx.com/00006009b4673bbc-ff2a-49bd-91fe-764c01b2acce01.tif"); new DownloadImagesTask().execute(image,this); }}