Skip to content

Instantly share code, notes, and snippets.

@smaugho
Last active May 4, 2017 12:52
Show Gist options
  • Save smaugho/d5cd35d888bd33df57f1559a266f1869 to your computer and use it in GitHub Desktop.
Save smaugho/d5cd35d888bd33df57f1559a266f1869 to your computer and use it in GitHub Desktop.
Navigating in the app with Actions
@EActivity(R.id.activity_settings)
public class SettingsActivity extends Activity {
@Click
void showProfile() {
$ProfileFragment();
}
@Click
void showNotifications() {
$NotificationsFragment();
}
@Click
void logout() {
$AlertDialog().message("Are you sure you want to logout?")
.positiveButton("Yes")
.negativeButton("Cancel");
//The method will continue if the user presses "Yes"
$MainActivity();
finish();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment