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, but can anybody give me an idea how to go about taking this 'array' of pictures and being able to scroll through them? A thought of mine was to have an ArrayList and add to it every picture taken/chosen, but I've run into logical problems with it (i.e. how to scroll through the ArrayList).
L Vasquez wrote:I can only find examples of an ArrayAdapter being used for ListViews. Do you mind going into a little more detail for me or directing me to a more specific resource? Thanks for your help.
I have little to no experience with them outside of the examples in a book i read, but i am willing to learn it with you.
IIUC, there is essentially no difference between the two, as an ArrayAdapter has specific methods for add, edit, delete, and list. Perhaps you can write the Adapter as if it were for a ListView (using the examples), and once it is working, switch it to an ImageView. Though, the ListView has controls to switch automatically, the ImageView does not, so you will have to change the source and refresh the image manually. Hmm...perhaps that obviates the need for the ArrayAdapter.
Oh! You can use a custom ListView to use images. I remember trying that once. The custom part means that instead of the ListView just showing text, you can define the repeated fragment inside it, and that can contain an ImageView. Let's find some examples: custom ListView ImageView