sqlite データベースから画像名を抽出し、その画像名を使用してドローアブル フォルダー内の特定の画像を検索し、アプリのギャラリー ウィジェットに表示することで、いくつかの画像を表示しようとしています。それは機能しますが、問題は写真が多すぎることです。アプリが大きくなりすぎるため、ドローアブルフォルダーにすべてを保存するのは意味がありません。写真をオンラインで公開し、代わりに個々の URL を sqlite データベースに保存することを考えています。このようにして、データベースから URL を取得し、その URL を使用して画像をダウンロードし、ギャラリー ウィジェットに表示できます。Lazy List について読みました (すばらしい仕事に感謝します!) が、アプリに実装する際に問題があります。以下は、ギャラリーに使用している現在のコードです。Lazy List を使用してオンラインから画像をダウンロードするように変更する方法がよくわかりません。どんな助けでも大歓迎です!=)
protected String pic1, pic2, pic3;
protected int Id, resID1, resID2, resID3;
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.result_details);
    Id = getIntent().getIntExtra("ID", 0);
    SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase();
    Cursor cursor = db.rawQuery("SELECT pic1, pic2, pic3 FROM database WHERE _id = ?", 
            new String[]{""+Id});
    pic1 = cursor.getString(cursor.getColumnIndex("pic1"));
    pic2 = cursor.getString(cursor.getColumnIndex("pic2"));
    pic3 = cursor.getString(cursor.getColumnIndex("pic3"));
    resID1 = getResources().getIdentifier(pic1 , "drawable", getPackageName());
resID2 = getResources().getIdentifier(pic2 , "drawable", getPackageName());
    resID3 = getResources().getIdentifier(pic3 , "drawable", getPackageName());
    Gallery g = (Gallery) findViewById(R.id.photobar);
    g.setAdapter(new ImageAdapter(this));
}
public class ImageAdapter extends BaseAdapter {
       int mGalleryItemBackground;
       private Context mContext;
       private Integer[] mImageIds = {
               resID1,
               resID2,
               resID3
       };
       public ImageAdapter(Context c) {
           mContext = c;
           TypedArray a = obtainStyledAttributes(R.styleable.Theme);
           mGalleryItemBackground = a.getResourceId(
             R.styleable.Theme_android_galleryItemBackground,
                       0);
           a.recycle();
       }
       public int getCount() {
           return mImageIds.length;
       }
       public Object getItem(int position) {
           return position;
       }
       public long getItemId(int position) {
           return position;
       }
       public View getView(int position,
           View convertView, ViewGroup parent) {
           ImageView i = new ImageView(mContext);
           i.setImageResource(mImageIds[position]);
           i.setLayoutParams(new Gallery.LayoutParams(150, 100));
           i.setScaleType(ImageView.ScaleType.FIT_XY);
           return i;
       }
    }