Marcus Berger Marcus Berger - 1 month ago 5
Android Question

Andorid Show once Box

I have see in many Apps a "FirstStart" View with hints from the App.
Titanium Backup shows at the first start a View with the Rules of the App and after this the Changelog.

Is this "FirstStart" a Addon or how can i make this ?


Not an addon. Just show a dialog using fragment manger and save a value to shared preferences.

Boolean isFirstRun = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE).getBoolean("firstRun", true);
    if (isFirstRun) {
        SharedPreferences sharedPreferences = getActivity().getApplicationContext().getSharedPreferences(SHARED_PREF, 0);
        SharedPreferences.Editor editor= sharedPreferences.edit();
        editor.putBoolean("firstRun", false);

        FragmentManager fm = getFragmentManager();

        MyDialogFragment dialog = new MyDialogFragment();, "myDialog");