我在android中很新,我想知道如果我在一個佈局中不使用「setOnClickListener」,會發生什麼情況,因爲看起來我的應用程序仍然可以正常運行而沒有任何錯誤。任何人都可以解釋我對我?在佈局上使用setOnClickListener
例如:
myLayout = (LinearLayout) findViewById(R.id.myLayout);
myLayout.setOnClickListener(this);
myLayout2 = (LinearLayout) findViewById(R.id.myLayout2);
除非您希望佈局可點擊,否則不需要它。 – PaulG 2014-10-27 20:26:10