2014-02-12 51 views
0

我試圖使圖像出現在一個if語句,但它不喜歡findviewbyId那麼,有沒有其他的方式來顯示圖像 - 錯誤說不能被解析爲一個變量在Android中,如何在不使用findViewByID的情況下顯示圖像?

public boolean play(int column){ 
    for (int r = 0; r <= 5;r++){ 
     if (getState(column, r) == State.BLANK){ 
      if (player1Turn == true){ 
       count[column][r] = State.RED;    
       //image 
       ImageView redCounter = (ImageView) findViewById.(R.id.redCounter); 

       //end 
      }else { 
+0

'它不喜歡findviewbyId'(。) - 你是什麼那是什麼意思? – Ahmad

+0

給出了這個錯誤無法解析爲一個變量 – user3299420

回答

4

問題您代碼後findViewById.

ImageView redCounter = (ImageView) findViewById.(R.id.redCounter); 

點刪除它是那樣的

ImageView redCounter = (ImageView) findViewById(R.id.redCounter); 
相關問題