Skip to content

Instantly share code, notes, and snippets.

@utsmannn
Last active December 27, 2018 03:00
Show Gist options
  • Save utsmannn/40ae072012901427c44c455a593bf7b4 to your computer and use it in GitHub Desktop.
Save utsmannn/40ae072012901427c44c455a593bf7b4 to your computer and use it in GitHub Desktop.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
....
// Pengambilan nilai intro
SharedPreferences preferences = getSharedPreferences("intro", Context.MODE_PRIVATE);
Boolean introComplete = preferences.getBoolean("intro_complete", false); // secara default nilai intro bernilai false
// Jika intro bernilai false
if (!introComplete) {
startActivity(new Intent(this, IntroActivity.class));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment