private OnClickListener createFloatingActionButtonListener ( ) { return new OnClickListener ( ) { @ Override public void onClick ( final View v ) { Toast toast = Toast . makeText ( MainActivity . this , R . string . floating_action_button_toast , Toast . LENGTH_SHORT ) ; toast . show ( ) ; } } ; }
Creates and returns a listener which allows to show a toast when a floating action button has been clicked .