【发布时间】:2019-09-22 10:42:38
【问题描述】:
NewText = (TextView)view.findViewById(R.id.mainn);
ChangeText = (ImageView)view.findViewById(R.id.ph);
// Create a list of words
ArrayList<String> words = new ArrayList<String>();
words.add("one");
words.add("two");
words.add("three");
words.add("four");
words.add("five");
words.add("six");
words.add("seven");
Words.add("eight");
words.add("nine");
words.add("ten");
ChangeText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//what code should I write here to change the text from one to two when I click the button??
}
});
【问题讨论】:
标签: android android-studio arraylist textview onclicklistener