我有一個導航按鈕,我在每個類中使用,並且想要在包含所有常見代碼的類中設置其onClickListener。但我得到一個 "The method startActivity(Intent) is undefined for the type new View.OnClickListener(){}"
錯誤在startActivity(i)。 相關的代碼是: public static void
我試圖從Android: The method OnClickListener() is undefined for the type View 這個例子,但我在.getC()得到一個錯誤: error at The method getC() is undefined for the type View.OnClickListener
希望有人能幫助我找到出。或者是否有另一種可能性來獲取偵聽
我嘗試使用此代碼來防止在ImageView中多次點擊,但它沒有幫助。 Boolean isClicked = false;
@Override
public void onClick(View v)
{
if (v == imgClick && !isClicked)
{
//lock the image
is