The situation I am struggling with:
One MainActivity and four fragments… …in a nutshell how to set a lost foccus event on a given EditText field contained on a Fragment?
In a simple activity this works very well.
protected void onCreate(Bundle savedInstanceState) {
oET_PSN = findViewById(R.id.txtEqPSN);
oET_PSN.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, boolean hasFocus) {
if(!hasFocus){
Log.d("oET_PSN", "Lost Focus");
}
}
})
….
….
But how to get this to work in a Fragment?
Various youtubes; Various stackoverflow posts… …I am looking for a simple example that can easily be replicated
New contributor
user23177095 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.