Loading Images from SD card to ViewPager Android
问题 I need to Load Images from a folder in SD Card into a ViewPager. This is what i have managed so far. public Drawable getImageFromSdCard(String imageName) { Drawable d = null; try { String path = Environment.getExternalStorageDirectory().toString() + "/YourSubDirectory/"; Bitmap bitmap = BitmapFactory.decodeFile(path + "/" + imageName + ".png"); d = new BitmapDrawable(bitmap); } catch (IllegalArgumentException e) { // TODO: handle exception } return d; } How can i set this as a ViewPager ? 回答1