From Android
I'm going to make it like this.
TextView remains unchanged
TEXT contains "OFF", "1", "2", and "3". If you press ◁ in this state, it goes down to OFF ▷ Press to go up to 3.
If you press ◁ while the contents of the TEXT are OFF, it will no longer go down and will remain OFF Similarly, you want to keep the number 3 on the TEXT even if you press ▷ while the number 3 written on it.
I'm going to put the contents of TEXT in an array like ArrayList or string What should I do?
Please tell me Crying.
android
List<String> list = ArrayList<>();
list.add("OFF");
list.add("0");
list.add("1");
list.add("2");
list.add("3");
int currentPosition = 0; //Default
textView.setText(list.get(currentPosition))
//When you click the right button
void rightBtnClick(){
if(currentPosition == 0) return;
textView.setText(list.get(--currentPosition));
}
//Click the left button
void leftBtnClick(){
if(currentPosition == list.size() -1) return;
textView.setText(list.get(++currentPosition));
}
I think it's going to be like this. I just wrote it, so please refer to the context only in case there are any mistakes.
552 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
545 GDB gets version error when attempting to debug with the Presense SDK (IDE)
551 Who developed the "avformat-59.dll" that comes with FFmpeg?
550 Understanding How to Configure Google API Key
546 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.