You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,31 @@ Intent intent = new Intent(this,OnboardingActivity.class);
74
74
intent.putExtras(onboardingActivityBundle);
75
75
startActivity(intent);
76
76
```
77
+
####Custom onButtonClick actions
78
+
By default, clicking a button in an **Onboarding Fragment** will move to the next one in the list.
79
+
If the **Onboarding Activity** is on the last **Onboarding Fragment**, it will simple `finish()` itself.
80
+
81
+
If you want something different to happen when the user clicks a button in an **Onboarding Fragment**, extend the **Onboarding Activitiy** and override the `onOnboardingClick` method.
82
+
83
+
It will pass the fragment position inside of the list that the user clicked.
84
+
```
85
+
public class MyOnboardingActivity extends OnboardingActivity {
86
+
87
+
@Override
88
+
public void onOnboardingClick(int position) {
89
+
Log.d("TAG", "Position is: " + position);
90
+
}
91
+
}
92
+
```
93
+
Next, simply start your **Onboarding Activity** instead of the normal one.
94
+
95
+
```
96
+
//Start your version of the Onboarding Activity
97
+
Intent intent = new Intent(this,MyOnboardingActivity.class);
0 commit comments