Android: How to show a "quick tour" when you first open the application?

I don’t know exactly how to explain this, but when many applications are launched, usually the user can scroll 3 or 4 screens that “view” / “quickly complete” the application before the user actually enters the application. How can I achieve this in Android?

+5
source share
1 answer

You do not need a library. What you can do is use ViewPager . It has different screens explaining different parts of the application.

To make sure that this only runs after you can get the following code in the FirstRunActivity onCreate () method:

boolean firstRun = getPreferences(Context.MODE_PRIVATE).getBoolean("firstRun", true); if (!firstRun) { Intent mainAppIntent = new Intent(getApplicationContext(), MainActivity.class); startActivity(mainAppIntent); finish(); return; } // Set up ViewPager and first run stuff 

After the first launch is completed and the user is in the application, you set the firstRun in SharedPreferences to false:

 getPreferences(Context.MODE_PRIVATE) .edit() .putBoolean("firstRun", false) .commit(); 
+4
source

Source: https://habr.com/ru/post/1209299/


All Articles