Skip to Content

Add a Change Flow

0 %
Add a Change Flow

Add a Change Flow

Add a change flow enabling a user to trigger the action to change the app's passcode.

You will learn

  • How to add a change flow to an app
QR code


  • Completed the previous tutorial in this mission which added the reset flow

In the restore tutorial, it was shown how the application responded to a change made in the management cockpit to the client policy. In the below steps, the user will trigger the action to change their passcode using the change flow.

Step 1: Add the code

Add the following method to

private void startChangeFlow() {
    LOGGER.debug("starting Change flow");
    // Creating flow and configuring steps
    Flow flow = new Flow("change");
    flow.setSteps(new Step[] {
        new ChangePasscodeStep()  // shows the enter, new, and confirm passcode screens

    flowManagerService.execute(flow, flowContext, new FlowActionHandler() {
        public void onFailure(Throwable t) {
            LOGGER.debug("onFailure in change called" + t);
            showAlertDialog("Change", t);

        public void onSuccess(FlowContext result) {
            LOGGER.debug("Change flow completed successfully.");

The change flow is unique in the sense that it simply uses the existing flowContext from the onboard or restore flow and then adds another step that enables users to change their passcode.

Add the following line to the onChange method.


Ensure that settingsDownloadStep.passcodePolicy = null; is commented out so that a passcode exists for the app. Otherwise onFailure will be called.

Log on to answer question
Step 2: Try it out

To test out the changing passcode functionality, tap the Change button.

Change button

A screen to prompt for the current passcode will be shown.

Enter passcode screen

Then a screen to create a new passcode will appear.

New passcode screen

Finally, the verify passcode screen will be shown.

Confirm passcode screen

Congratulations! The code to perform a change flow has been added enabling a user to change their app’s passcode.

What does the Change flow do?

Next Steps

Back to top