Button myButton = (Button) findViewById(R.id. my_button)
As much I know in java all code have to be on a class body, that said if we invoke a method we must have to call it through object or if it's a static method then through its class name like bla.findViewByID(somemoreblass)
But in android studio I see this Button myButton = (Button) findViewById(R.id. my_button)
Can anyone explain how it works?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…