視圖的ID我使用10+左右按鍵MyActivity extends Activity implements OnClickListener{
檢索該被點擊
此活動引用,並具有setOnClicklistener(this)
方法叫上每個按鈕。
@Override
public void onClick(View v){
//here I need to get the id of the view that was clicked...
//Depending on the button that was clicked different actions need to be called...
//How do I get the ID of the button that was clicked...
}
使用開關盒 – stackoverflow 2013-05-01 10:21:47
爲什麼不先谷歌它? http://developer.android.com/reference/android/view/View.html#getId() – httpdispatch 2013-05-01 10:21:58
首先使用google。 – 2013-05-01 10:24:12