I added a button to change text (in the array) when clicking on it.
When the current index reaches the length of the array, I need a toast message to pop up, and also not to update the current index.
But there are errors. Please help me!
This my code:
public void onClick(View v) {
if (currentIndex == 22) {
Toast.makeText(azka.this, "YOUR MESSAGE", Toast.LENGTH_SHORT).show();
return;
}
currentIndex++;
simpleTextSwitcher.setText(strings[currentIndex]);
}