Skip to content

Change Passcode

Basically, it consists of the Enter passcode screen and the Create passcode screens.

Add Change passcode screen activity to your manifest file

The ChangePasscodeActivity should be added to the AndroidManifest.xml file in an activity xml tag. It is required to specify also the "action_handler" meta-data tag.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
   <activity
    android:name="com.sap.cloud.mobile.onboarding.passcode.ChangePasscodeActivity"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"
    android:parentActivityName=".ApiDemos">
  <meta-data
      android:name="action_handler"
      android:value="com.sap.cloud.mobile.fiori.demo.onboarding.PasscodeActionHandlerImpl"/>
  <meta-data
      android:name="android.support.PARENT_ACTIVITY"
      android:value=".ApiDemos" />
</activity>

Start the ChangePasscodeActivity

There are two ways to start Change passcode scenario:

  1. Call via the EnterPasscodeActivity with PasscodeSettings configuration's changePasscode flag is set true. For example:
1
2
3
4
5
 Intent i = new Intent(this,
                com.sap.cloud.mobile.onboarding.passcode.EnterPasscodeActivity.class);
 PasscodeSettings settings = new PasscodeSettings();
 settings.setChangePasscode = true;
 startActivityForResult(i, CHANGE_PASSCODE);
  1. Or directly the ChangePasscodeActivity can be started with standard startActivityResult method of the Activity. For example.:
1
2
3
 Intent i = new Intent(this,
                com.sap.cloud.mobile.onboarding.passcode.ChangePasscodeActivity.class);
 startActivityForResult(i, CHANGE_PASSCODE);