1
這是我的功能,我應該打個電話應該將哪個視圖對象傳遞給具有View對象作爲菜單參數的函數?
public void myLocation (View v){
MyMapSettings(MY_LOCATION);
showMyAddressOnMap();
drawGeofencesAround(MY_LOCATION, false);
}
我打電話從這裏上面的功能:
@Override
public boolean onOptionsItemSelected(MenuItem item) { switch(item.getItemId()) {
case R.id.add:
myLocation(View v); // I am getting error "Cannot resolve symbol".
return(true);
case R.id.reset:
//add the function to perform here
return(true);
case R.id.about:
//add the function to perform here
return(true);
case R.id.exit:
//add the function to perform here
return(true);
}
return(super.onOptionsItemSelected(item));
我想知道我應該傳遞給函數的我是什麼樣的看法在打電話嗎?
謝謝,它的工作原理。 – jason