发现程序有BUG啊
public ArrayList<WordButton> initWordsSelected(){
ArrayList<WordButton> selectedWordList = new ArrayList<WordButton>();
for (int i = 0; i < mCurrentSong.getSongNameLength(); i++) {
Log.i("msg","+1答案框");
View view = Util.getView(MainActivity.this,R.layout.self_ui_gridview_item);
final WordButton holder = new WordButton();
holder.mViewButton = (Button) view.findViewById(R.id.id_wordButton);
holder.mViewButton.setTextColor(Color.WHITE);
holder.mViewButton.setText("");
holder.isVisible = false;
holder.mViewButton.setBackgroundResource(R.drawable.game_wordblank);
// holder.mViewButton.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Log.i("msg","答案清楚");
// // clearAnswer(holder);
// }
// });
selectedWordList.add(holder);
}
return selectedWordList;
}
以上代码是实现答案框,通过debug发现程序根本不会执行 holder.mViewButton.setText("");及之后的代码,这是怎么回事,循环未结束自己跳出一次循环