垃圾需要改进

 
 
 
 
private class downloadImage extends AsyncTask<String, Integer, Bitmap> {
    Bitmap[] bms;

    @Override
     protected Bitmap doInBackground(String... arg0) {
       // TODO Auto-generated method stub
      bms = new Bitmap[arg0.length];
       for ( int i = 0; i < arg0.length; i++) {
        Bitmap bm = Common.GetImages(arg0[i], "219.136.252.234");
        bms[i] = bm;
        publishProgress(i);
      }
       return null;
    }

    @Override
     protected void onProgressUpdate(Integer... values) {
       // TODO Auto-generated method stub
      adapter = new ImageAdapter(Activity_Gallery. this, bms);
      galleryFlow.setAdapter(adapter);
      adapter.notifyDataSetChanged();
       super.onProgressUpdate(values);
    }

    @Override
     protected void onPostExecute(Bitmap result) {
       // TODO Auto-generated method stub
      adapter = new ImageAdapter(Activity_Gallery. this, bms);
      galleryFlow.setAdapter(adapter);
      adapter.notifyDataSetChanged();
      galleryFlow.setSelection(5, true);
      setGalleryMovie( true);
       super.onPostExecute(result);
    }

  }
 
 
Android 如何用gallery批量显示网络图片.弄成那种在线浏览网页的图片.

你可能感兴趣的:(职场,private,休闲)