Skip to content

FirstBackPressAction

Kaushik NP edited this page May 13, 2018 · 1 revision

Create object of FirstBackPressAction

Passed in :

.withFirstBackPressAction(FirstBackPressAction)

Override the actionCall() method when creating the Object. This method is called when the first back press occurs.

Below is an example where after the first back button press, the Activity shows a Toast to the user.

FirstBackPressAction firstBackPressAction = new FirstBackPressAction() {
    @Override
    public void actionCall() {
        Toast.makeText(ExampleActivity.this, "Press back again to Exit", Toast.LENGTH_SHORT).show();
    }
};
Clone this wiki locally