Resources res = getResources(); String apple = res.getString(R.string.word_apple); String girl = res.getString(R.string.word_girl); String man = res.getString(R.string.word_man); String boy = res.getString(R.string.word_boy); String family = res.getString(R.string.word_family); String child = res.getString(R.string.word_child); private String[] questions = {"", girl, man, boy, family, child, apple, ""}; count = 0; And the OnClickListener method
Button butCheck = (Button)findViewById(R.id.button); TextView textView = (TextView)findViewById(R.id.textView); butCheck.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(count<8){ count++; textView.setText(questoins[count]); }else{ Intent intent = new Intent(Activity.this, Second.class); startActivity(intent); } }
count? Where is it initialized? - Suvitruf ♦