Variables with underline

后端 未结 6 1595
轮回少年
轮回少年 2020-12-28 12:23

I\'m getting an underline in some variables on Android Studio (in this case on the \'position\' variable). I think it\'s not an error because the application runs perfectly

6条回答
  •  感动是毒
    2020-12-28 12:56

    This means the variable was declared outside the current method. For example, in this case, position is probably declared as a class member outside the new DialogInterface.OnClickListener(), in the class where you're implementing the onItemLongClick() method.

    They are declared like this:

    public class MyClass{
        private int position;
    
        // Other code...
    
    }
    

提交回复
热议问题