5
Si prega di leggere i 2 commenti nel seguente codice.Come posso accedere all'oggetto di classe principale da una funzione all'interno della classe in Java?
public class Field extends LinearLayout {
public void init() {
setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
// I want to access the main object 'Field' here(not the class, the object)
}
});
// to be clear the object referred as 'this' from HERE should be accessed from where the above comment is.
}
}
È possibile? Esiste una parola chiave per accedere all'oggetto di classe principale da una funzione all'interno dell'oggetto?
scusate, pensavo che la classe interiore e la classe esterna fossero diverse da questa – SadeepDarshana