Click here to Skip to main content
15,907,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a ToggleButton (ON/OFF), two buttons (PicButton and NextButton) and an ImageView.

Toggle ON: Clicking PicButton will ask you to pick 4 pictures (either with camera or from gallery); ImageView remains blank.

Toggle OFF: Clicking PicButton will display the first of the 4 pictures in ImageView. Clicking NextButton will show the next picture (of the 4).

At the moment, I have a ToggleButton and a boolean associated with its state. My PicButton prompts the user to take a picture with the camera or choose one from gallery and displays it in the ImageView via the URI. My NextButton does nothing.

I don't necessarily need code (which is why I didn't provide any of mine), but can anybody give me an idea of how to go about taking this 'list' of pictures and being able to display each of them by clicking next?

What I have tried:

A thought of mine was to have an ArrayList of URI's and add to it every picture taken/chosen, but I've run into other logical problems with it (i.e. how to scroll through the ArrayList).
Posted
Comments
[no name] 3-Aug-16 5:34am    
Pseudo Code (I don't know Java):

ArrayList imageURIList = new ArrayList();
int currentImageIndex= 0;

PicButtonClicked && Togle OFF:
currentImageIndex= 0;
ShowCurrentImage();

NextClicked:
if (currentImageIndex < imageList.size())
{
currentImageIndex++;
ShowCurrentImage();
}
else
{
// i.e. restart scrolling
currentImageIndex= 0;
}

ShowCurrentImage()
{
if (currentImageIndex < imageList.size())
{
imagePath= imageURIList.get(currentImageIndex);

// Now load here the image located at imagePathto your ImageView
// ...
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900