So, I have this “next” button which calls a string array and when count reaches “-1” I would like to start a new view. How can I do this?
Button nextButton = (Button) findViewById(R.id.next_button);
nextButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
if (count < myString.length) {
lessonsDialog.setText(myString[count]);
count++;
} else {
if (count < myString.length [-1]) {
handler2.sendEmptyMessageDelayed(MESSAGE_SHOW_POPUP2, TIME_DELAY2);
}
}
}
});
Нou can call removeView(View child); and addView(View child); on ViewGroup.
Example