/** Create a new instance of ImageDetailFragment, providing an image file to be displayed. */ static ImageDetailFragment newInstance(File imageFile) { ImageDetailFragment f = new ImageDetailFragment(); // Supply the file's path as an argument. Bundle args = new Bundle(); args.putString("file", imageFile.getPath()); f.setArguments(args); return f; }
/** Returns a fragment that displays the Bitmap at the requested position in the directory. */ @Override public Fragment getItem(int position) { Log.v(TAG, "getItem" + position); mCurrentImage = position; // Create a new ImageDetailFragment holding the Image // stored at the File in the requested position. return ImageDetailFragment.newInstance(mBitmapFiles.get(position)); }
@Override public Fragment getItem(int position) { return ImageDetailFragment.newInstance(Images.imageUrls[position]); }