Android Question Logic Question

Douglas Farias

Expert
Licensed User
Longtime User
hi i m noob in programation xD
i m crazy here
i go explain my problem

i have 8 imageview

i need make when you take a photo save a 1.jpg

later load 1.jpg on imageview1

ok

now i want to take a photo again
i take a photo and i want to save

i need to make if have a photo 1.jpg save with the name 2.jpg
imageview2 = 2.jpg

take another photo
if have 1 or 2 save 3.jpg
imageview3 = 3.jpg

and this 8 times

if have 1.jpg at 8.jpg
begin again
1.jpg - replace old 1.jpg to new and go to 8 again

how can i make this logic?
 

DonManfred

Expert
Licensed User
Longtime User
#Use a global variable at initialize it with 0. After each picture taken you increment this value.... and save the variable&".jpg" and put it to imageview "variable"...
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
how can i set +1 ?

if file 1.jpg exist save 2.jpg
if 2.jpg save 3.jpg and etc etc

get last file and insert +1

if have image 55 save image 56
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
HAVE YOU EVER READ THE DOCUMENTATION?
You are NOT able to increment a variable on 1+???

Before asking here in forum you SHOULD ALWAYS search the forum for a solution! ALL you asked in the last weeks could be found if you USE the search.
 
Last edited:
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
i know make a variable but the problem is ready in folder 1.jpg exist or 2 3 4 5 6 7 8
etc

but i have a ideia now i go make a count in the folder get result in int and add +1
if have 5 files
put 5 files + 1 = 6.jpg *-*
 
Upvote 0
Top