問題已得到解答,請參閱下面有關如何解決問題的詳細答案。Android Gridview增量問題
gridView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int val, long arg3)
{
if(gameCounter > maximum)
{
Toast.makeText(getApplicationContext(), "Congrats you finished the game" , Toast.LENGTH_SHORT).show();
}
}
});
當代碼進入'onItemClick'時,'val'是什麼?還有什麼'count'等於? – tyh
val是視圖的位置,count實際上是gameCounter對於混淆抱歉! – CatLikeOlive0
任何更多的幫助將非常感謝我似乎已經擊中了一面磚牆:/ – CatLikeOlive0