I have a gallery with bunch of images. I'm able to perform onItemClick for one image. But I want to add left/right buttons to get the pervious/next image. How can I do that? Below is the code for onItemClick
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long arg3) {
ModelGallery model = (ModelGallery) mListView.getItemAtPosition(position);
Intent intent = new Intent(getActivity(), GalleryActivity.class);
startActivity(intent);
Here's the activity class. Loading the image from the URL passed from the Fragment class.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gallery);
final ImageView imageView = (ImageView) findViewById(R.id.full_image);
final String imageUrl = getIntent().getStringExtra("imageURL");
Ion.with(imageView)
.placeholder(R.drawable.ic_loading)
.error(R.drawable.ic_error)
.load(imageUrl);
}