Adding Welcome / Intro screens in your app is a great way of showcasing the major features of the app. Previously I explained about adding a static Splash Screen to your app. In this article we are going to learn how to add an intro slider to your app where user can swipe through few slides before getting into app.

To demonstrate, I am creating a simple app that contains few intro slides with next and skip navigation. The user can navigate through each slide using swipe gesture or using the next button. I’ll also explain how to show the intro only when the app is launched for the first time.

android welcome intro slider with bottom dots

Here is the final app we are going to build.

android welcome slider animation with dots

Let’s start by creating a new project.

1. Creating New Project

1. Create a new project in Android Studio from File ⇒ New Project. When it prompts you to select the default activity, select Empty Activity and proceed.

2. Download this res.zip and add them to your projects res folder. This zip file contains few drawable images required for this app.

2. Choosing the Colors

It’s completely upto you how you design the intro screens considering the type of app you are building. For this example, I am placing a big image in centre and few texts below it. At the bottom, number of dots are placed indicating the number of slides it has.

Below is the color palette I have selected to design the screens. For every screen we need three colors i.e background color and two dot colors when it is active / inactive.

welcome slider color pallete

3. Open colors.xml located under res ⇒ values and add the below color values. You can see after adding the colors, I have kept them into arrays array_dot_active and array_dot_inactive, so that we can load them easily in our activity.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <!-- Screens background color-->
    <color name="bg_screen1">#f64c73</color>
    <color name="bg_screen2">#20d2bb</color>
    <color name="bg_screen3">#3395ff</color>
    <color name="bg_screen4">#c873f4</color>

    <!-- dots inactive colors -->
    <color name="dot_dark_screen1">#d1395c</color>
    <color name="dot_dark_screen2">#14a895</color>
    <color name="dot_dark_screen3">#2278d4</color>
    <color name="dot_dark_screen4">#a854d4</color>

    <!-- dots active colors -->
    <color name="dot_light_screen1">#f98da5</color>
    <color name="dot_light_screen2">#8cf9eb</color>
    <color name="dot_light_screen3">#93c6fd</color>
    <color name="dot_light_screen4">#e4b5fc</color>

    <array name="array_dot_active">
        <item>@color/dot_light_screen1</item>
        <item>@color/dot_light_screen2</item>
        <item>@color/dot_light_screen3</item>
        <item>@color/dot_light_screen4</item>
    </array>

    <array name="array_dot_inactive">
        <item>@color/dot_dark_screen1</item>
        <item>@color/dot_dark_screen2</item>
        <item>@color/dot_dark_screen3</item>
        <item>@color/dot_dark_screen4</item>
    </array>
</resources>

4. Open strings.xml located under res ⇒ values and add the below string values. Here I am mentioning a title and description for each slide.

<resources>
    <string name="app_name">Intro Slider</string>
    <string name="title_activity_welcome">Home Screen</string>
    <string name="next">NEXT</string>
    <string name="skip">SKIP</string>
    <string name="start">GOT IT</string>

    <string name="slide_1_title">Hello Food!</string>
    <string name="slide_1_desc">The easiest way to order food from your favourite restaurant!</string>

    <string name="slide_2_title">Movie Tickets</string>
    <string name="slide_2_desc">Book movie tickets for your family and friends!</string>

    <string name="slide_3_title">Great Discounts</string>
    <string name="slide_3_desc">Best discounts on every single service we offer!</string>

    <string name="slide_4_title">World Travel</string>
    <string name="slide_4_desc">Book tickets of any transportation and travel the world!</string>

    <string name="play_again_desc">To see the welcome slider again, goto Settings -> apps -> welcome slider -> clear data</string>
    <string name="play_again">Play Again</string>
</resources>

5. Open dimens.xml located under res ⇒ values and add the below values.

<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="fab_margin">16dp</dimen>
    <dimen name="dots_height">30dp</dimen>
    <dimen name="dots_margin_bottom">20dp</dimen>
    <dimen name="img_width_height">120dp</dimen>
    <dimen name="slide_title">30dp</dimen>
    <dimen name="slide_desc">16dp</dimen>
    <dimen name="desc_padding">40dp</dimen>
</resources>

6. Also make sure that you have these styles in your styles.xml as the app is crashing because of recent changes in build tools.

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>

The welcome / intro slider should be shown only once when the app is launched for the very first time. If the user launches the app on second time, he should directly go to main screen. To achieve this, we use SharedPreferences to store a boolean value indicating first time launch.

7. Create a class named PrefManager.java and do the below changes. isFirstTimeLaunch() returns true if the app is launched for the first time.

package info.androidhive.introslider;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Lincoln on 05/05/16.
 */
public class PrefManager {
    SharedPreferences pref;
    SharedPreferences.Editor editor;
    Context _context;

    // shared pref mode
    int PRIVATE_MODE = 0;

    // Shared preferences file name
    private static final String PREF_NAME = "androidhive-welcome";

    private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";

    public PrefManager(Context context) {
        this._context = context;
        pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
        editor = pref.edit();
    }

    public void setFirstTimeLaunch(boolean isFirstTime) {
        editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
        editor.commit();
    }

    public boolean isFirstTimeLaunch() {
        return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
    }

}

3. Creating the Welcome Slides

Now it’s time to create the layouts required for the slider. In total I am keeping 4 slides for the intro screen. So we need four separate layouts for four slide. The layout of each slide remains the same except the images, text and colors. Alternatively you can create separate Fragment for each slide to have more control over the UI elements displayed in the slide.

8. So quickly create four xml layouts named welcome_side1.xml, welcome_side2.xml, welcome_side3.xml and welcome_side4.xml under res ⇒ layouts.

welcome_slide1.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_screen1">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <ImageView
            android:layout_width="@dimen/img_width_height"
            android:layout_height="@dimen/img_width_height"
            android:src="@drawable/ic_food" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/slide_1_title"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_title"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:paddingLeft="@dimen/desc_padding"
            android:paddingRight="@dimen/desc_padding"
            android:text="@string/slide_1_desc"
            android:textAlignment="center"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_desc" />

    </LinearLayout>
</RelativeLayout>

welcome_slide2.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_screen2">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <ImageView
            android:layout_width="@dimen/img_width_height"
            android:layout_height="@dimen/img_width_height"
            android:src="@drawable/ic_movie" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/slide_2_title"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_title"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:paddingLeft="@dimen/desc_padding"
            android:paddingRight="@dimen/desc_padding"
            android:text="@string/slide_2_desc"
            android:textAlignment="center"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_desc" />

    </LinearLayout>


</RelativeLayout>

welcome_slide3.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_screen3">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <ImageView
            android:layout_width="@dimen/img_width_height"
            android:layout_height="@dimen/img_width_height"
            android:src="@drawable/ic_discount" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/slide_3_title"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_title"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:paddingLeft="@dimen/desc_padding"
            android:paddingRight="@dimen/desc_padding"
            android:text="@string/slide_3_desc"
            android:textAlignment="center"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_desc" />

    </LinearLayout>

</RelativeLayout>

welcome_slide4.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_screen4">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <ImageView
            android:layout_width="@dimen/img_width_height"
            android:layout_height="@dimen/img_width_height"
            android:src="@drawable/ic_travel" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/slide_4_title"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_title"
            android:textStyle="bold" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:paddingLeft="@dimen/desc_padding"
            android:paddingRight="@dimen/desc_padding"
            android:text="@string/slide_4_desc"
            android:textAlignment="center"
            android:textColor="@android:color/white"
            android:textSize="@dimen/slide_desc" />

    </LinearLayout>

</RelativeLayout>

9. Once the layouts are ready, create a new activity named WelcomeActivity.java for the welcome slider. Right Click on package New ⇒ Activity ⇒ Empty Activity.

10. Open activity_welcome.xml and modify the code as below. Here I am adding ViewPager for slider, LinearLayout for bottom dots and two buttons for Skip and Next navigation.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:showIn="@layout/activity_welcome">


    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <LinearLayout
        android:id="@+id/layoutDots"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dots_height"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="@dimen/dots_margin_bottom"
        android:gravity="center"
        android:orientation="horizontal"></LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:alpha=".5"
        android:layout_above="@id/layoutDots"
        android:background="@android:color/white" />

    <Button
        android:id="@+id/btn_next"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:background="@null"
        android:text="@string/next"
        android:textColor="@android:color/white" />

    <Button
        android:id="@+id/btn_skip"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:background="@null"
        android:text="@string/skip"
        android:textColor="@android:color/white" />

</RelativeLayout>

11. Open WelcomeActivity.java and modify the code as below. Here I have taken care of few things

> Check for the fist time app launch using prefManager.isFirstTimeLaunch() method. If it returns true, MainActivity will be launched skipping the intro activity.

> Made the notification bar transparent, so that the view background color can be seen through.

> Created a PagerAdapter for the ViewPager and inflated all the layouts we created earlier.

> Added click event listener to Skip and Next buttons. If next button is clicked, next slide will be shown. If Skip button is clicked, main activity will be launched directly.

package info.androidhive.introslider;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class WelcomeActivity extends AppCompatActivity {

    private ViewPager viewPager;
    private MyViewPagerAdapter myViewPagerAdapter;
    private LinearLayout dotsLayout;
    private TextView[] dots;
    private int[] layouts;
    private Button btnSkip, btnNext;
    private PrefManager prefManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Checking for first time launch - before calling setContentView()
        prefManager = new PrefManager(this);
        if (!prefManager.isFirstTimeLaunch()) {
            launchHomeScreen();
            finish();
        }

        // Making notification bar transparent
        if (Build.VERSION.SDK_INT >= 21) {
            getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
        }

        setContentView(R.layout.activity_welcome);

        viewPager = (ViewPager) findViewById(R.id.view_pager);
        dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
        btnSkip = (Button) findViewById(R.id.btn_skip);
        btnNext = (Button) findViewById(R.id.btn_next);


        // layouts of all welcome sliders
        // add few more layouts if you want
        layouts = new int[]{
                R.layout.welcome_slide1,
                R.layout.welcome_slide2,
                R.layout.welcome_slide3,
                R.layout.welcome_slide4};

        // adding bottom dots
        addBottomDots(0);

        // making notification bar transparent
        changeStatusBarColor();

        myViewPagerAdapter = new MyViewPagerAdapter();
        viewPager.setAdapter(myViewPagerAdapter);
        viewPager.addOnPageChangeListener(viewPagerPageChangeListener);

        btnSkip.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                launchHomeScreen();
            }
        });

        btnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // checking for last page
                // if last page home screen will be launched
                int current = getItem(+1);
                if (current < layouts.length) {
                    // move to next screen
                    viewPager.setCurrentItem(current);
                } else {
                    launchHomeScreen();
                }
            }
        });
    }

    private void addBottomDots(int currentPage) {
        dots = new TextView[layouts.length];

        int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);
        int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);

        dotsLayout.removeAllViews();
        for (int i = 0; i < dots.length; i++) {
            dots[i] = new TextView(this);
            dots[i].setText(Html.fromHtml("&#8226;"));
            dots[i].setTextSize(35);
            dots[i].setTextColor(colorsInactive[currentPage]);
            dotsLayout.addView(dots[i]);
        }

        if (dots.length > 0)
            dots[currentPage].setTextColor(colorsActive[currentPage]);
    }

    private int getItem(int i) {
        return viewPager.getCurrentItem() + i;
    }

    private void launchHomeScreen() {
        prefManager.setFirstTimeLaunch(false);
        startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
        finish();
    }

    //	viewpager change listener
    ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageSelected(int position) {
            addBottomDots(position);

            // changing the next button text 'NEXT' / 'GOT IT'
            if (position == layouts.length - 1) {
                // last page. make button text to GOT IT
                btnNext.setText(getString(R.string.start));
                btnSkip.setVisibility(View.GONE);
            } else {
                // still pages are left
                btnNext.setText(getString(R.string.next));
                btnSkip.setVisibility(View.VISIBLE);
            }
        }

        @Override
        public void onPageScrolled(int arg0, float arg1, int arg2) {

        }

        @Override
        public void onPageScrollStateChanged(int arg0) {

        }
    };

    /**
     * Making notification bar transparent
     */
    private void changeStatusBarColor() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);
        }
    }

    /**
     * View pager adapter
     */
    public class MyViewPagerAdapter extends PagerAdapter {
        private LayoutInflater layoutInflater;

        public MyViewPagerAdapter() {
        }

        @Override
        public Object instantiateItem(ViewGroup container, int position) {
            layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

            View view = layoutInflater.inflate(layouts[position], container, false);
            container.addView(view);

            return view;
        }

        @Override
        public int getCount() {
            return layouts.length;
        }

        @Override
        public boolean isViewFromObject(View view, Object obj) {
            return view == obj;
        }


        @Override
        public void destroyItem(ViewGroup container, int position, Object object) {
            View view = (View) object;
            container.removeView(view);
        }
    }
}

12. Finally open AndroidManifest.xml and make WelcomeActivity as launcher activity. So that it will be shown as the first screen in the app.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.androidhive.introslider">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="info.androidhive.introslider.WelcomeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="info.androidhive.introslider.MainActivity"
            android:label="@string/title_activity_welcome"
            android:theme="@style/AppTheme.NoActionBar"></activity>
    </application>

</manifest>

Run the app and play with awesomely looking intro sliders 🙂

Ravi is hardcore Android programmer and Android programming has been his passion since he compiled his first hello-world program. Solving real problems of Android developers through tutorials has always been interesting part for him.
  • Sohail

    Thanks I was interested in making welcome slides

    • Then here it is.

      • kiran pawar

        sir owesome tutorial

        • kiran pawar

          how to add the bottom dots to viewpager

          • It is already explained in this article.

          • kiran pawar

            ok got it

        • Thanks Kiran.

          • kiran pawar

            Ok got sir

  • thanks

  • Andres Melgarejo Ledesma

    thanks for your tutos my friend! great as always!

  • Nur Rochim

    Hello Ravi, Thanks for your tutorials, its very help me

    • You are welcome.

      • Nur Rochim

        do you have SIP tutorail ?

  • Nitesh

    Thank you very much. you helped me a lot.You are awesome Bro 🙂

  • Raghu dayala

    Hey buddy, you are awesome…..I’m learning more of Android from your posts only. Keep it up……

  • Hardik Mehta

    exactly what i need..thnk u so much..

  • Wysnu

    great works, thankyou again (y)

  • tohin

    Thanks bro

  • Trey Rosius

    soo beautiful and yet so simple…great work bro

  • Ziigic

    Awesome tutorial. It’s very help me. Thank you.

  • Prerna Samrat Tyagi

    thank you so much its really so good

  • Fabio

    Thanks Rabi.

  • Fernando Souza

    Thanks!!

  • AbelardoLG

    Thanks Ravi.

    When I run the app an error was showed:
    java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

    The mentioned activity is “HelloIntroSlider.java” -> your MainActivity.java

    What is wrong?

    Thumbs up FOR YOU TIME&TUTORIALS!

    • Have you used the style I mentioned in this article? Also verify the styles assigned in AndroidManifest.xml

      • Soham Railkar

        I had same problem.

      • AbelardoLG

        All was OK. Thanks for your reply and I am sorry for the delay of my answer.

  • Thanks for sharing your knowledge….

  • Manu Babu

    Hi Ravi, thanks a lot for all the awesome tutorials bro, i have a request for you, i am facing problem with app component which performs sync operations from my android phone contacts to my server just like whatsApp and Viber contact sync…. since there is no good explanations for how to build it in internet , i request you to help us by writing a tutorial on it….Thank you 🙂

  • vivek pratap singh

    Hello Ravi, Thanks for this update. I was looking for this activity only and you helped me again. Keep posting, your post help lots of new developer.

  • Anbuselvan Rocky

    Wow.. waited so long for this.. Thank you will try it asap Now 🙂

  • sangeetha s

    not able to download res.zip file

  • Chiru Katti

    great article brother
    Chiranjeevi from AP

  • nagaraj

    hi, ravi….how can we auto rotate the images instead of doing it manually with specific time interval???

  • kanika Tandel

    great job..your article is awsome.Thanks for your tutorials, its very help me.

    • You are welcome 🙂

      • Rekha Mor

        Hi..Ravi…i made app using ur tutorial..but when i am running it …its working with no errors..but the problm is it is not showing any slider…it is just showing white background with all white texts and all slider dots all in color ..Please help me

  • Ian Nechenje

    I get the following error when I include tools:showIn=”@layout/activity_welcome” in activity_welcome.xml
    “The surrounding layout (@layout/activity_welcome) did not actually include this layout. Remove tools:showIn=… from the root tag.”
    When I run the app, a white activity_welcome.xml is the one lauched. No slides.

    • Akanksha Verma

      hey same here! Did u find the solution for this?

  • Ange Bagui

    Good tutorial Ravi. can i know your source drawable images to search myself another images.

    • Use thenounproject.com

      • Ange Bagui

        Thank you!

  • Ramu M

    hi, may i use grid view in the introslider?

  • surender ramola

    Nice Tutorial Ravi, I am Using A library AppIntro for same intro can u show the demo in the future article …

  • Shafayat Mamun

    Hellop Ravi, Can you please do a tutorial about android performance?

    • In which area you want to increase the performance?

      • Shafayat Mamun

        Rendering, Code, Memory and Battery.

      • Ruyonga Dan

        Can you do something about load heavy images from remote servers…i have tried to use libraries like picasso and Glide but some how i still get out of memory errors

  • Sandeep Pradhan

    Sir there is a correction….it is posted that( So quickly create four xml layouts named welcome_side1.xml, welcome_side2.xml, welcome_side3.xml and welcome_side4.xml under res ⇒ layouts.)…..u missed a letter l in slide…and wrote side instead of slide…..thnx sir

  • Enrique

    Wow! Awesome Tutorial Ravi, thank you so much for the awesome stuff.
    I’m gonna use this for my next project.
    Just a question, can i disable the scroll property from the views?

  • Android Lover

    hey i am of 16 so i don’t have enough knowledge about java but i am trying to make a musicplayer which like spotify because i have never seen any good online music player available Indians and most of them are not free….

    so here is my source :- https://github.com/Grace5921/Music_browser

    and i want to add Notification while playing music from website .

    thanks for any help

    • Dheeraj Parashar

      Hi there, I am interested in looking into your app. Can you be more specific ?

      • Android Lover

        I waited long for any reply but not got any help any where so i delete all sdk and apks bla bla bla but source is still in my github

        • Dheeraj Parashar

          Yes, i saw that! And you must not lose hope so quickly. Come contact me at parashardheeraj@yahoo.com. We’ll see what can we do.

          • Android Lover

            Done

  • Michel LifeSaver

    Hello, how can i add a fifth element? I try to add a new xlm view to the array but.. when i try to slide to that 5th screen i got array bounce error?

  • adam

    How you record screen videos from app ?
    Do you have a Tool ?can you tell ? i mean your post videos

    • ARASHI Funsho

      He uses android studio. As long as your have a device running android 5.0 and above, click on android monitor tab and locate the “screen record” icon when the app is running. click it to record device screen and the video will be saved to the pc. Hope this helps….

  • vinod

    sir, your tutorial is super. how we implement image slider with swipable !!!!!

  • alex tello

    thank you so much!! master!!

  • tamer

    thank you very much ravi

  • HARISH

    Hai Mr.Ravi, How can we put single background with slide effect in viewPager like ola viewPager.?

  • Bhoomika

    sir there’s an error: Cannot resolve method ‘addOnPageChangeListener’ . How to remove it?

    • Rahul kishan

      rename as setOnPageChangeListener

  • Kavan Vadaliya

    how to remove play again button in this code i tried to remove button code on xml but not a posible pls answer me

  • makA

    Hi
    I have a question .. how can I use typefaces in this project? specially in welcome slides

  • Akram Baratov

    I made app like this by using your tutorial. If i run in Lollipop version it works so good. But if i run in KitKat version, after slider it crashes

  • Vinoth Vino

    Thank you so much!!!

  • Manish Kumar

    I am getting few errors . How to resolve?

    /Users/manishkumar/Downloads/IntroSlider/app/build/intermediates/bundles/debug/instant-run/AndroidManifest.xml
    Error:(28, 28) No resource found that matches the given name (at ‘theme’ with value ‘@style/AppTheme.NoActionBar’).
    Error:Execution failed for task ‘:app:processDebugResources’.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Users/manishkumar/Library/Android/sdk/build-tools/23.0.3/aapt” finished with non-zero exit value 1

    • Rahul kishan

      U might have not added values->style

    • Sandeep Pradhan

      add this too in ur styles.xml

      false
      true

      • Manish Kumar

        got it solved . it wasn’t this but due to some other error. Can you please help me starting a new activity on click of each card . like different activity for different card.

    • Ayush Shrivastava

      How did u solve it?

  • Rahul kishan

    Ravi You are Awesome 🙂 !!where can i learn ui design?

  • Ruyonga Dan

    Great post…we appreciate your efforts

  • Shailesh Limbadiya

    This is very nice and it is very helpful for me. If possible then please help me that i
    want that when i swipe and second slider page is display at that time i click on the second slider page then start new activity i don’t know
    where and how to set onclick()?

  • Vinoth Vino

    Can’t able to add textview in linearlayout.My app force stop when “dotsLayout.removeAllViews();” executes. I tested with logcat. and if I comment “dotsLayout.removeAllViews();” then it executes upto “dots[i].setTextColor(colorsInactive[currentPage]);” when it comes to “dotsLayout.addView(dots[i]);” then my app force stopped. I’ve problem with LinearLayout(dotslayout) but I checked with your code and it has the same code. Why it didn’t working only for me?

    • Adam Lages

      sorry for my English! I’m from Brazil!
      To correct this error >>> java.lang.ArrayIndexOutOfBoundsException: length = 4; index = 4 << res > values > colors.

      @color/dot_light_screen1
      @color/dot_light_screen2
      @color/dot_light_screen3
      @color/dot_light_screen4
      @color/dot_light_screen5
      @color/dot_light_screen6

      @color/dot_dark_screen1
      @color/dot_dark_screen2
      @color/dot_dark_screen3
      @color/dot_dark_screen4
      @color/dot_dark_screen5
      @color/dot_dark_screen6

  • Adi Trioka

    can it be made continous scroll?

  • Arihant Jain

    Ravi sir, thank you so much for the awesome stuff.
    I made app like this by using your tutorial. If i run in Lollipop version it works so good. But if i run in KitKat version, after slider it crashes

  • dhvani shukla

    sir thank you so much for this tutorial. but i have one question when second time directly main activity lauch so what i do..

    • Laxman Basawa

      main activity is supposed to launch. slider will come only once.

  • Amaninder Singh

    Error:(28, 28) No resource found that matches the given name (at ‘theme’ with value ‘@style/AppTheme.windowActionBar’).

    • Koorosh Ghorbani

      define this in your style.xml

  • william donnelly

    Ravi – Question…

    When adding more than the four layouts that are in your tutorial the application crases when the addBottomDots() method is called due to an error in the array size….Removing the for loop within this method allows me to add as many layouts as I like without the error. I’ve had a look thry but Im not seeing where/why the size of the arrays are different since when I include a toast to output the array size, its all correct.

    I note below somebody else also had this same error. Do you have a solution for it???

    Here is what I added to layouts:

    layouts = new int[]{
    R.layout.welcome_slide1,
    R.layout.welcome_slide2,
    R.layout.welcome_slide1,
    R.layout.welcome_slide2,
    R.layout.welcome_slide3,
    R.layout.welcome_slide4};

    This is the for loop causing the error

    for (int i = 0; i < dots.length; i++) {
    dots[i] = new TextView(this);
    dots[i].setText(Html.fromHtml("•"));
    dots[i].setTextSize(35);
    dots[i].setTextColor(colorsInactive[currentPage]);
    dotsLayout.addView(dots[i]);
    }

    java.lang.ArrayIndexOutOfBoundsException: length=4; index=4
    at com.wotadoo.android.wotadoo.Activities.ActivityGetListed6.addBottomDots(ActivityGetListed6.java:116)
    at com.wotadoo.android.wotadoo.Activities.ActivityGetListed6.access$400(ActivityGetListed6.java:28)
    at com.wotadoo.android.wotadoo.Activities.ActivityGetListed6$3.onPageSelected(ActivityGetListed6.java:139)

    • Adam Lages

      sorry for my English! I’m from Brazil!
      To correct this error >>> java.lang.ArrayIndexOutOfBoundsException: length = 4; index = 4 << res > values > colors

      @color/dot_light_screen1
      @color/dot_light_screen2
      @color/dot_light_screen3
      @color/dot_light_screen4
      @color/dot_light_screen5
      @color/dot_light_screen6

      @color/dot_dark_screen1
      @color/dot_dark_screen2
      @color/dot_dark_screen3
      @color/dot_dark_screen4
      @color/dot_dark_screen5
      @color/dot_dark_screen6

  • Costa

    Hi.Thanks for tutorial. On first load everything worked but how to play(call) WelcomeActivity again ?

    • Costa

      Never mind. it’s solved

  • Sabin B S

    Hi, I want these welcome slides again and again when I am reopen the app.. For that what i have to do?

    • Laxman Basawa

      in WelcomeActivity.java, private void launchHomeScreen() function. there is
      prefManager.setFirstTimeLaunch(false);
      make it prefManager.setFirstTimeLaunch(true);

  • muna

    i’m getting error
    Error:(8, 8) error: class PrefManager is public, should be declared in a file named PrefManager.java

  • vikrant singh rawat

    Hello sir i am using this method for multiple page registration activity ….
    but in last , i clicked in submit button my application is crash…
    edit text get null value after finding debug….

    • Fritz Quaye

      me too, my app crashes

  • Laxman Basawa

    awesome article. i tried and got result.. thank you Ravi…

    • You are welcome.

      • AjayB

        Ravi, The theme seems to have some problem when we compile this with Andriod Studio & compile ‘com.android.support:appcompat-v7:23.4.0’. I get an error
        Error:(28, 28) No resource found that matches the given name (at ‘theme’ with value ‘@style/AppTheme.NoActionBar’).

        How to resolve it?

      • Kinshu Mathur

        you are grate man awasom site grate for beginners even useful for expert programmers thanks

  • Fritz Quaye

    my app crashes after i click in the final button. and it shows me a null pointer exception. this is the logcat

    Process: com.playmaker.BudgetOh, PID: 29987
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playmaker.BudgetOh/com.playmaker.BudgetOh.activities.OpeningActivity}: java.lang.NullPointerException
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2328)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
    at android.app.ActivityThread.access$900(ActivityThread.java:169)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5476)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.NullPointerException
    at com.playmaker.BudgetOh.activities.OpeningActivity.onCreate(OpeningActivity.java:51)
    at android.app.Activity.performCreate(Activity.java:5451)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2386)
    at android.app.ActivityThread.access$900(ActivityThread.java:169)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:136)
    at android.app.ActivityThread.main(ActivityThread.java:5476)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
    at dalvik.system.NativeStart.main(Native Method)

    and it points to this code to the destination activity

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    • Victoria

      How did you fix it?

  • Gaurav Gupta

    this is article is very awesome, I implemented it and fine working , thanks bro

  • Fritz Quaye

    My app crashes after i click on “Got it” and the logcat refers me to my actionBar code in my main activity

  • Walid Thalib

    i cant download code with google,, error code

    401. That’s an error.

    Error: deleted_client

    The OAuth client was deleted.

    Request Details

    access_type=offline

    scope=email

    response_type=code

    redirect_uri=http://download.androidhive.in…

    client_id=632068769776-mh56k25o4c5hun9as…

    and the other login same, it back to an option login with.
    thank you for help..

  • Praveen Kumar

    This code is awesome. I searched many examples and was unsuccessful to provide intro slides for my application, even i tried github libraries to implement, but i didnt find a way. This code works perfect and saved my time.

  • Sharkes Monken

    I gotta survive this semester with android unit. Bookmark this site 🙂

  • Manu Sarangal

    Hey Ravi! very helpful article! Keep up the good work 🙂

  • Dozie

    Thanks so much androidhive…..i love this site.. …if like tapping all the ads here….. at least little thank-you fall to ur account

  • pawan kumar

    sir can u help for posting and getting data from login and signup page by url

  • Fuad_saneen

    how can I select a random slide as current view

    • You can use this code

      viewPager.setCurrentItem(3);

  • Arvind Kumar Sharma

    Can we pick Navigation Drawer Activity instead of Empty activity?

    • Yes, but make WelcomeActivity as launcher activity in AndroidManifest.xml

      • Arvind Kumar Sharma

        setContentView(R.layout.activity_welcome);
        Error : Can’t resolve symbols ‘R’

        Thanks Ravi…. and once again, grate post…

        • Make sure that you don’t have any errors in layout files. Clean & Build the project again from Run menu.

  • Naresh Jadhav

    how can i show this slider each and every time i open my aap

    • You shouldn’t call this line anywhere your app prefManager.setFirstTimeLaunch(false);

      This was called, once the slider is completed in launchHomeScreen() in WelcomeActivity.java

      • Naresh Jadhav

        Thanks Ravi….you are awesome…..

        • You are welcome 🙂

          • nickjhonatam

            I do not understand, I have the same idea of always making it visible.
            How do I do it in the code below?

            // Checking for first time launch – before calling setContentView()
            prefManager = new PrefManager(this);
            if (!prefManager.isFirstTimeLaunch(false)) {
            launchHomeScreen();
            finish();
            }

          • Remove this code

            prefManager = new PrefManager(this);
            if (!prefManager.isFirstTimeLaunch(false)) {
            launchHomeScreen();
            finish();
            }

  • prince mahipal

    Hlo ravi
    I have query can u plzz help me about that
    I want to ask u that can i integrate the coding given by u for drawer activity and tab activity its urgent

  • Muchamad Jeffri Ardyansyah

    Halo ravi.

    Thanks to make great tutorial.
    i want to ask about auto scroll slide like this library https://github.com/Trinea/android-auto-scroll-view-pager?

    Thanks before

  • Shahbaz Hussain

    Hello Sir,

    I failed to understand how the dots were added, as you have only defined color for it, but not the shape of it

  • Youssef Wagih

    Very useful and well detailed tutorial.

  • Daniel Quicazan

    Sir, you are my savior, thanks a lot!

  • Rizky Nofriwandi

    i cann’t download it.. it just me ?

    • What is the problem?

      • João Gabriel Ulian

        Link is broken

        • Fixed now.

          • Rizky Nofriwandi

            it’s still the same.. my downloader cannot downloaded your code cause it didn’t show the size in my internet download manager.. when i started to downloaded it can downloaded..

          • Rizky Nofriwandi

            i mean it cannot downloaded in last sentecess..

          • don’t use any download managers.

  • Hosein Saad

    awesome.
    Tnx So much.
    Can I ask something Unrelated?

    How I cant set margins to a button(for example) but from java file not xml????

  • Sachin Rajput

    how to take reference of all views present in all my intro slider screens in introslider activity to set typeface

  • João Gabriel Ulian

    I can’t download res.zip

  • Muthu Vasan

    Sir please provide mainactivity

    • MainActivity doesn’t have anything. Just create an empty activity.

  • Sushant Chopra

    Ty sir, you made it a piece of cake..

  • shashi patil

    ravi sir u r awesome

  • Alwin Lazar

    sir how to add two slides extra to the intro? I am just added the new layout window_slide5.xml, window_slide6.xml
    but when I swipe from the slide 4 to 5 the app crashes. How to solve this?

  • Chandragupta Cg

    I did everything as you mentioned but when the app was launched for the first time it directly opened the home page activity not the intro(swiping part)..

    • Make sure that the launcher activity is intro activity in AndroidManifest.xml

      • Chandragupta Cg

        Thank you 🙂
        It worked,.

  • Kirti

    How can I use images for dots? and I need to change font style for text on slider pages.

  • Sonali

    Okay, now, I tried this code. It worked perfect for the first time. When I try to open the app again, it takes me to the main activity which displays “Hello World”. I cannot figure out where the code needs to be corrected. Please suggest.

    • macfrater

      That’s how the example was done to work, nothing wrong with the code, it’s perfect. Just clear app cache/data and open the app again.

  • Walid Al Ashik

    You save my life 🙂 🙂
    Its worked.

  • Sandeep Semlani

    Very nice code Thanks. but i am stuck on last activity. i want to show list view on last screen. can you please help?

  • Abu Nayem

    can i open slider page from middle page? if yes. how can i do?

    • Abu Nayem

      ok solved. 🙂

  • Lê Công Trực

    Rendering Problems
    The surrounding layout (@layout/activity_welcome) did not actually include this layout. Remove tools:showIn=… from the root tag.

    • Lê Công Trực

      Remove tools:showIn=… and its worked. :))

  • Victoria

    Thanks a lot!!!! I’m a beginner and your post is incredibly helpful!!

  • Govardhana J

    Thank you so much

  • Mapp Maasin

    how to add slider, mine crashes.

  • Naman Jain

    I have a doubt sir,
    dots[i].setText(Html.fromHtml(“•”)) is deprectaed and we have to add a flag parameter in this function,
    but which flag to use?

  • ahsan

    Ravi Tamada i follow your code i get an error of attempt to invoke virtual method ,null pointer exception error

  • 411 UG

    Hello Ravi, I would like to know how to use both a splash screen and intro slider in the same app

  • Amrutha Jayaram

    sir is there any online course from ur side about advance android concepts

  • Vinicius Chagas

    help me!

    error: cannot find symbol method addOnPageChangeListener(OnPageChangeListener) Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

    • Vinicius Chagas

      ok solved. 🙂

  • Amrutha Jayaram

    its ok sir Tq u for ur reply

  • Masud Parvez

    There is a bug in MyViewPagerAdapter class. In this class you wrote

    layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    this line is wrong you have to use

    layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    and as well have to change the constractor to

    public MyViewPagerAdapter( Context context,int[] layouts){

    this.layouts = layouts;
    this.context = context;
    }

    and in the Activity have to use

    adapter = new MyViewPagerAdapter(getBaseContext());

  • Enes KURU

    Thank you very much 🙂 It was very helpful.

  • Hutama Trirahmanto

    Hello Ravi, I’ve tried a slider tutorial but when I click “GOT IT” forceclose. What should I do? I tried with android nougat

  • Thiago Paim F Rodrigues

    Awesome tutorial! So much better than the official android documentation

  • Puneet Kaur

    First time Intro slider had worked fine. But Now If I Launch the App it shows “Unfortunately, Intro Slider has been Stopped”. Please help

  • Dhwani Shah

    This is an amazing tutorial. Thank you!!
    I have one question – If I want to take user inputs in this intro sliders, how should I do that?

  • Anil Kumar

    when i add one more layout then gives error arrayIndexoutOf Bound please help me sir !!

  • kunal

    nice one

  • Junielo Guardalupe

    Thanks for the tutorial sir

  • Prashant Rathore

    java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

    what to do?

  • pradeep

    Thanks for the tutorial . You are Awesome !!

    Small Request :
    fromHtml was deprecated in API level 24.

    Updated Code
    if (Build.VERSION.SDK_INT >= 24)
    {
    dots[i].setText(Html.fromHtml(“•”,Html.FROM_HTML_MODE_LEGACY));
    }
    else
    {
    dots[i].setText(Html.fromHtml(“•”));
    }

  • Wanderson Jackson

    How to add this current android app that already has a splash screen????

    • Make this activity as Launcher activity instead of SplashActivity in AndroidManifest.xml

      • Wanderson Jackson

        i did that but it return an error:

        01-02 17:51:06.031 31033-31033/br.com.trocados.trocadosapps E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.trocados.trocadosapps/br.com.trocados.trocadosapps.view.activity.introscreen.WelcomeActivity}: android.content.res.Resources$NotFoundException: String resource ID #0xff9fc460
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
        at android.app.ActivityThread.access$900(ActivityThread.java:157)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5530)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:733)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623)
        Caused by: android.content.res.Resources$NotFoundException: String resource ID #0xff9fc460
        at android.content.res.Resources.getText(Resources.java:327)
        at android.widget.TextView.setText(TextView.java:4642)
        at br.com.trocados.trocadosapps.view.activity.introscreen.WelcomeActivity.addBottomDots(WelcomeActivity.java:106)
        at br.com.trocados.trocadosapps.view.activity.introscreen.WelcomeActivity.onCreate(WelcomeActivity.java:66)
        at android.app.Activity.performCreate(Activity.java:6272)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
        at android.app.ActivityThread.access$900(ActivityThread.java:157)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5530)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:733)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:623)

  • sopheap chheng

    Hello, I saw you post is so cool! I wonder if you can add the text is moved slower than the background. let me know if you do it.

  • Mahdi Hamidi Amin

    thats verrrrrrrrrrrrrrrrrrrrrrrrrrrry gooood
    thanks

  • StardustHaze

    I need your help; I followed all of your instructions and some others from YouTube but every time the app launches it says that it can’t be started and crashes. I get a Null Point exception error that points that addBottomDots(0) and dotsLayout.removeAllViews()

    I hope you can help me, I’ve been stuck for the past two days.

    here is the logcat:
    Process: cloud.introscreen, PID: 28864
    java.lang.RuntimeException: Unable to start activity ComponentInfo{cloud.introscreen/cloud.introscreen.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.LinearLayout.removeAllViews()’ on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
    at android.app.ActivityThread.access$1100(ActivityThread.java:222)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.LinearLayout.removeAllViews()’ on a null object reference
    at cloud.introscreen.MainActivity.addBottomDots(MainActivity.java:127)
    at cloud.introscreen.MainActivity.onCreate(MainActivity.java:80)
    at android.app.Activity.performCreate(Activity.java:6876)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
    at android.app.ActivityThread.access$1100(ActivityThread.java:222)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    01-04 19:17:22.855 28864-28864/cloud.introscreen I/Process: Sending signal. PID: 28864 SIG: 9

    • Priya Dharshini

      how u resolve this?

      • deaspo

        HI try to remove the line
        tools:showIn=”@layout/activity_welcome”
        from activity_welcome.xml then clean your project and checks if the layout renders fine

  • Kevin Cando

    Hi, First let me thank you for this awesome tutorial, it’s really really good. But I’m stuck with the pref_name in prefmanager where I can get the pref_name for my current project?

  • Zid

    Thanks for the tutorial, but I get this error: Error:(71, 18) error: cannot find symbol method addOnPageChangeListener(OnPageChangeListener).

  • LEO

    Thank you for the great tutorial.
    I’m studying android nowadays and i have a question 🙂

    I add a button at “welcome_slide4” and want to working click listener.
    I have no idea for solving it.

    I hope you understanding my question 🙂
    Thanks!

    • saeedk

      just set onClick=”function name”; in your xml and in WelcomeActivity create a public void function(View v){}. don’t forget to add View v as parameters to function as in my code. otherwise it will crash.

  • Namsi Abdelkhalek

    thanks this is helpful
    i’ve integrated this to my app with 7 layouts that contains images
    in some phones (even some powerful ones like samsung s6) it crashs (out of memory error)
    you have some tricks to optimize the loading of the images??

  • Priya Dharshini

    I need your help; I followed all of your instructions and some others from YouTube but every time the app launches it says that it can’t be started and crashes. I get a Null Point exception error that points that addBottomDots(0) and dotsLayout.removeAllViews()

    I hope you can help me.

    here is the logcat:
    Process: cloud.introscreen, PID: 28864
    java.lang.RuntimeException: Unable to start activity ComponentInfo{cloud.introscreen/cloud.introscreen.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.LinearLayout.removeAllViews()’ on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
    at android.app.ActivityThread.access$1100(ActivityThread.java:222)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.LinearLayout.removeAllViews()’ on a null object reference
    at cloud.introscreen.MainActivity.addBottomDots(MainActivity.java:127)
    at cloud.introscreen.MainActivity.onCreate(MainActivity.java:80)
    at android.app.Activity.performCreate(Activity.java:6876)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
    at android.app.ActivityThread.access$1100(ActivityThread.java:222)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    01-04 19:17:22.855 28864-28864/cloud.introscreen I/Process: Sending signal. PID: 28864 SIG: 9

    • deaspo

      Hi, could you please check where you’re implementing the code removeAllViews() and make sure the views are already instantiated

  • deaspo

    Thanks alot

  • mehdi

    I cannot download Code and APK file. 🙁

  • mehdi

    I cannot download Code and APK file. 🙁
    please help me. im Iraninan.

  • Shoghi Bagul

    @ravi8x:disqus , Thanks a lot! The tutorial was very easy to understand and implement. What if I wish to play the welcome tutorial again using a button. Can you help me that?

    • I guess that part is already explained in Main Activity code.

  • Neha Sharma

    What we have to do for Auto Slide?

  • Shabz

    Thanks alot for the tutorial it’s working fine for me but i have a question. the MainActivity which came after the sliders are not showing the settings bar. i have also commented that part where you’re calling the transparent method but it is still not working and actionBar is being displayed after the slider in any other activity. can you help explain why? and how to get that back?

  • naina

    how to use image view slier in android studio

  • Neha Sharma

    How to increase size of dots? and one thing more Sir how to make Notification Bar transparent for api level less then 21 Any Custom Code for that? Please tell me.

    • I believe you need to increase the text size in order to increase the dot size dots[i].setTextSize(35); I don’t think transparent will work in lower versions. See if there are any support library for that.

  • Elaman Tun

    how can i implement color changing for the line above the dots, to be the same as inactive dots?? by the way , thanx for this complete project is awesome.

  • Ravikiran

    My API level 19 doesn’t work it .. plz solution.. above versions worked..

  • Sudesh Bishnoi

    i want to make a gallery app can u help for this,i want a simple code for directry

  • Hein Htet

    Where is main activity i cant found that please where i get it

  • Hein Htet

    PLEASE where can i download source code

    • Download button is there at the beginning of the article.

      • Hein Htet

        Bro i cant download that. Email is already verify but that say need email verify ..:( Please How i can get it bro thank

  • Akshra Khurana

    I really like these tutorials…thanks !

  • Shahid

    perfect !

  • Saranya Vangala

    Where is main activity i cant found that please where can i get it

    • There is nothing in MainActivity. It’s just an empty activity.

  • Saranya Vangala

    i can’t download the source code. Could you help me with this @ravi8x:disqus

    • Please login using any social accounts.

      • Saranya Vangala

        i tried using google its giving this error …. deleted_client

        • Sorry! I think Github is working fine. (Need to re-code the entire website)

          • Saranya Vangala

            ok.. Thank you for the great tutorial.

          • You are welcome:)

  • Subin Babu

    How to add a button to intro slide one and get click event

    • Why Don’t you try to add viewpager by> right click on your package>new>activity> TabbedActivity>select swipe views there > finish. Then you can have buttons in your fragment’s layout, I hope that approch will be easy for you.

  • ewiskan

    Hi, Thanks for great and clear tutorial, are this possible to open some webpage url after we click ” GOT IT” button ? how we can add that, maybe something like web view ?

    • Do you want to open the WebView (which opens in the same app) or open external browser?

      • ewiskan

        in same apps for sure..

      • kiran

        When I click on Skip or GOT IT ,my app say unfortunatly stopped and app get closed .
        what to do if i want to go in Main_Activity after pressing ‘GOT IT’ and ‘SKIP’ .@ravi8x:disqus .

  • Tom James

    amazing. thank you

  • Karytonn Oliveira

    Thank you for helping!
    This tutorial is Good and Simple for understand.

  • Omar El-Elaimy

    Could you please tell me how to make this order of pages..
    1) Splash screen as launcher page in the manifest.
    2) Slider for the welcome activity
    3) Main Activity.

    Thanks in advance.

    • Moe Lalati

      set ur splash screen as the launcher activity from manifest file, in java file of the splash screen after the timeout give an intent to the welcome activity , and an intent from the got it button to the main activity

  • Aakash Soni

    hello ravi, where you find the images for the intro slider??

  • Islem Djarallah

    I found this tutorial very useful, but I need help .

    is it work For android 4.4 and less ??

  • Prasenjit Hiwale

    Sir thank you for this tutorial but i have got following error at run time

    java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.widget.TextView.setTextColor(int)’ on a null object reference

    • valentine rutto

      this means the textview does not exist. just make sure you have it initialised it. or the color int …just check to make sure they exist. or initiliased in the class you are using

  • Le Thanh Tan

    Dear Ravi Tamada
    I have done this topic, but now I would like, each layout which is a fragment, on that, We can onClick and do anythings.

    For example: We have 3 layouts, and final layout which is a Login layout, on that we have sign in, sign up, and so on.. and I use fragment to do that. and what should I do to solve this problem.
    Thanks.

  • Muhamad Aditya

    i can’t download the source code. It’s direct to material tabs download not intro slider. Please help me….

  • Ankit Rawat

    I am getting this error, Please help sir!

    Error:Could not find any matches for com.android.support.constraint:constraint-layout:+ as no versions of com.android.support.constraint:constraint-layout are available.
    Required by:
    project :app

    • Nguyễn Y Nguyên

      you can try to change the version of constraint-layout to version 25.3.1. Good luck :3

  • Nguyễn Y Nguyên

    thanks bro 🙂 Your tuts are so nice 🙂

  • SQDev

    Thanks !!!

  • Rohit

    sir i have increased welcome slider but it is giving me array out of bound. i am not getting how to solve this error.please help

    • Pls post the error log.

    • amit sharma

      Please make sure you have Defined array_dot_inactive and array_dot_active array in color.xml of same size of layouts[].

      • Jesse

        I had the same issue. To better explain: If you used only one color for your intro, be sure that the number of strings in the arrays (dot_inactive & dot _active) is equal to the number of layout/slide in your App Intro.

  • Phando

    Hi~ thank you for the awesome tutorial. I followed all steps and went over it a few but the app crashes without any errors. It just says “app has stopped x Close app”. Any ideas of what could be the problem?

  • Sama24

    Brilliant tutorial! Just one problem, I added another welcome slide in both the xml and the Welcome Activity:

    layouts = new int[]{

    R.layout.welcome_slide_1,

    R.layout.welcome_slide_2,

    R.layout.welcome_slide_3,

    R.layout.welcome_slide_4,

    R.layout.welcome_slide_5};

    Now when I run the app and flip through the into slide, when I try and go to the last slide the app is crashing due to a ArrayIndexOutOfBoundsException. This is strange seeing as the array length for both dots and layouts is not hardcoded. Here is the error:

    ATAL EXCEPTION: main

    Process: uk.ac.bradford.taskmanager, PID: 27458

    java.lang.ArrayIndexOutOfBoundsException: length=4; index=4

    at uk.ac.bradford.MyTaskScheduler.IntoSliderActivity.addBottomDots(IntoSliderActivity.java:112)

    at uk.ac.bradford.MyTaskScheduler.IntoSliderActivity.access$400(IntoSliderActivity.java:24)

    at uk.ac.bradford.MyTaskScheduler.IntoSliderActivity$3.onPageSelected(IntoSliderActivity.java:135)

    at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1939)

    at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:687)

    at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:671)

    at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:632)

    at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:613)

    at uk.ac.bradford.MyTaskScheduler.IntoSliderActivity$2.onClick(IntoSliderActivity.java:92)

    at android.view.View.performClick(View.java:6207)

    at android.widget.TextView.performClick(TextView.java:11094)

    at android.view.View$PerformClick.run(View.java:23639)

    at android.os.Handler.handleCallback(Handler.java:751)

    at android.os.Handler.dispatchMessage(Handler.java:95)

    at android.os.Looper.loop(Looper.java:154)

    at android.app.ActivityThread.main(ActivityThread.java:6692)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

    • amit sharma

      Make sure you have Defined array_dot_inactive and array_dot_active array in color.xml of same size of layouts[].

  • Rahul Maheshwari

    Very Useful and brilliantly explained tutorial website i found on this earth.
    Buddy your content is unique and is explained thoroughly.
    You upload tutorials of android things that are in current trend which every android developer is curious to learn.
    Keep doing good and Cheers to your work and you 😀

    • Thanks for your appreciation Rahul. I’ll continue my work 🙂

  • Хома Хомячок

    Thanks, works great, the only thing that 1 line of code cause render problems for me, so i deleted it.
    ” tools:showIn=”@layout/activity_welcome” ” and now its just fine.

  • Nashit Bhati

    Thank you soo much Ravi

  • Oscar David Iglesias

    Great Tutorial, only one Question, how can I instantiate and handle a button located in each slide.xml in my WelcomeActivity?

  • Ken Choong

    Thanks Ravi..this again help me alot.

  • orçun

    adamsın bee 😀

  • Хома Хомячок

    Mr. Ravi, can I use code part of this tutorial in my bachelor thesis with all references to your great website?

  • amit sharma

    How Can I get the button which is inside second screen of PageAdapter. I want to implement onClik event on that.

    • Хома Хомячок

      pbly u need to create java activity for that

  • Shubham Bansal

    Ravi, thanks for this tutorial. But I want to request you for one tutorial on “The accessibility tour that you see when you install the app first time”. I am trying to do that for my app for a long time, but I did not find any help or source.

  • Iman Borumand

    hello

    work on eclipse?

  • Thanks !!!!!!!!

  • Sergio Tajuelo

    Hello i have a problem. First thanks for the tutorial.
    My problem is that in the Manifest you put “AppTheme.NoActionBar” and in the styles dont appear.

    Thanks

    • Nataly Didenko

      Oh I’ve fix it =) Added “android:theme=”@style/AppTheme.NoActionBar”” into WelcomeActivity description in AndroidManifest.xml

  • Nataly Didenko

    @ravi8x:disqus thank you for amazing tutorial. One question: I added welcome screen to my existing app according your instruction, everything works fine but there is toolbar above welcome. Please suggest how to fix it. Screenshot https://www.dropbox.com/s/qrdgobmie4mj4dt/Screenshot_2017-06-08-15-30-10-766_kz.sportlive.png?dl=0

    • Chinmay Kulkarni

      Make sure you have entered theme in manifest file
      android:theme=”@style/AppTheme.NoActionBar”

  • Emilio Sanchez

    What if I want to have 1 webview as one of those sliders and the others stay just layouts?

  • Stephen BJ

    hey bro u r awesome

  • Titi

    Tnanks,
    but i want to ask you a question,
    how can i change the text of the TextView ?
    I can’t reference this TextView, and i have an exception when i use getViewById(R.id.textview_id)

    • You need to consider this code block

      @Override
      public Object instantiateItem(ViewGroup container, int position) {
      layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

      View view = layoutInflater.inflate(layouts[position], container, false);
      container.addView(view);

      return view;
      }

      Write view.findViewById() in this method.

      • Titi

        Thank you so so match

      • Hi Ravi,

        I tried to get the ID of an ImageView under my first slide by using the view.findViewById method, however the id returned is null, can you guide me on how to get the Id of the image under the slides for the inflated view passed to the inflate method

      • Vikash Sharma

        It is not working even after using view

        • Hi Vikash ,

          I had to use fragments and inflate each layout inside them , instead of directly inflating them.

  • Himesh

    Thanks. Great tutorial. But just one question, can I add fading animations to each slide as it changes? If so, can you please explain, how?

  • SATYAJIT TARAFDAR

    Is it possible to add “DOTS” effect in horizontal recyclerview without using ViewPager?

  • kvr.ptl

    I just wanted the same by using mobile step dots (Android material design) , if so how ?

  • Khaled Walid

    i need the slider one only start , for example user who first application it show him slider , then when he open the application again it don’t show the slider can you help me for this ?

    • Khaled Walid

      @ravi8x:disqus

    • nickjhonatam

      But the application in the tutorial is set to only show the user once. Did not you realize? Now I’m wanting is to make it appear always, do you know where I should modify?

      • Anant Saini

        Checking for first time launch – before calling setContentView()

        Comment this above function in your welcome activiity. Line number 35-36 to be approximate.

  • J.Will

    Hi, great tutorial there, I’m a newbie in android studio and this tutorial is really helpful. However, is it possible to add a splash screen on top of the slider? Thank you.

  • himanshi puniya

    it’s really helpfull thanks sir and give us others helfull links

  • Barak

    Hi Ravi – great work. Question:
    Am I authorized to use your code samples in a commercial app I’m currently working on? I’m willing to use large amount of code from this “intro-slider” work of yours, and I can’t find any license around…
    This website’s terms of service are confusing – they don’t make it clear whether your code is part of it or not.

    I’d appreciate your response.
    Barak

  • Vaishali Kharbanda

    hiee ravi…my application is force closing…tried many times…there not any option so that i can show you mine project…???

  • nickjhonatam

    Where do I modify it so that it is always visible when I access my application? Because it is set to show only once.

  • vinaykumar

    Hi Ravi.. I am able to increase selected slide dot size with (dots[currentPage].setTextSize(40)) and size is increases for selected dot .. but that selected dot is goind down where the unselected dot’s are in one line…is there any solution for this to bring bigger(selected do) and small dot’s in one lane and one more qn is that when i opens first time the dots are showing littile down and when a slide to next screen dots are jumping to up and till i close dot’s remian in same place…
    And thank you so much for your great tutorial.
    Mee talent maku chala upayogapduthundi…mee talent ki joharlu

    • You need to set text size in addBottomDots() method too. dots[i].setTextSize(40);. Other question should be fixed with solution or let me know.

      • vinaykumar

        where the layoutDots layout hieght is 30 dp i was getting problem when I am setting dots[i].setTextSize(30); and dots[currentPage].setTextSize(40); , now i changed height 30 dp to wrap content. now the smaller dots(Unselected dots) bigger dot(Selected dot) are in one lane.. But i am facing problem that when we launch welcome activity first time The layoutdot layout is showing liitile down..once i start sliding it’s perfectly setting where i want.. Now only the problem is.. when i launch welcome activity first time ,,layout dot layout should show at perfect place it shouldn’t show down.. thanks for befiore reply… and thanks in advance ee problem ki kuda solution dorikithey..

  • nickjhonatam

    Taking advantage of the opportunity, as I do so that at the same time it is loaded, for example;
    I extend to 5 seconds the splash to your view, and the url load in the background?

    So when the splash finished being displayed the site was already loaded at the time of the splash transition and webview.

    Do you have any tutorials like that ??

  • Sara

    Thank you so much for this Tutorial, it was really useful.
    i Just have one question, how can i implement the replay button?

    • This code worked for me ! Hope helps you too !

      PrefManager prefManager=new PrefManager(this);
      prefManager.setFirstTimeLaunch(true);
      Intent intent = new Intent(MainActivity.this, WelcomeActivity.class);
      startActivity(intent);

  • Felix Peer

    Hi Ravi, how can I definite, that the Slider starts with the second and don’t with the first site?

  • mayank

    i am having an error in the R file, should i make a new R class.

    • You might have errors in xml layout. R file will be generated automatically once you solve the errors.

  • It was really useful. Well , how can i implement the replay button? @ravi8x:disqus

  • Great one.. Thanks again Ravi..

  • Is this way how to build intro slider for your app legal ?

  • Mohammad Kokhaee

    hi how i can go main activity by clicking on “got it” and “skip” (sorry i’m new)

  • 苏铭

    Hi?
    Why create a public class MyViewPagerAdapter extends the PagerAdapter class?

  • sakshi mohinia

    it was really helpful but when i click next my main home activity is opened as i passed the intent but when i again open my application this slider wont appear directly my homeactivity is openend even i have declared slider activity as launcher help me ?

    • There is code related to storing flag in shared preferences indicating app first time launch. Comment that code.

      • sakshi mohinia
      • sakshi mohinia

        sir m student of btech cse
        i am doing training in android for 6 months can you please suggest me some good projects or any application to develop

      • sakshi mohinia

        public class PrefManager {
        SharedPreferences pref;
        SharedPreferences.Editor editor;
        Context _context;

        // shared pref mode
        int PRIVATE_MODE = 0;

        // Shared preferences file name
        private static final String PREF_NAME = “androidhive-welcome”;

        private static final String IS_FIRST_TIME_LAUNCH = “IsFirstTimeLaunch”;

        public PrefManager(Context context) {
        this._context = context;
        pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
        editor = pref.edit();
        }

        public void setFirstTimeLaunch(boolean isFirstTime) {
        editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
        editor.commit();
        }

        public boolean isFirstTimeLaunch() {
        return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
        }

        }

  • John Clinton Mwangi

    Works really nice

  • Harish nair

    When i click the button Done in the 4th slider the app force closes and when i open again it force closes. Where can I add a code to move to some other activity if i click Done or When i start the app again.
    I tried in MainActivity as well as in launchHomeScreen method. Still no results

  • Manoz

    Thank u man

  • Elad

    Thanks so much for this awesome guide! I was wondering: Where did you get these images? I really like their design and was hoping I can find similar images for my project as well.

    Thanks!

    • Check thenounproject.com but check the licenses of images too.

      • Elad

        Thanks a lot!
        Did you colorize the images in code or did you simply download a white version?

        • I have downloaded black png images. You can apply png tint color in android code itself.

  • Luca Chirichella

    Thanks for the wonderful guide, I have a question.
    Where I can change the textview typeface of all layouts in viewPager, into WelcomeActivity?
    Thanks.

    • You can apply typeface to individual TextViews or change the entire app font family in styles.xml

      • Luca Chirichella

        Thank you for the reply.
        but in which part of the code do i go to declare the texview relative:

        layouts = new int[] {
        R.layout._slide_1,
        R.layout._slide_2,
        R.layout._slide_3,
        R.layout._slide_4};

        class MyViewPagerAdapter extends PagerAdapter?

        • The layout files are in res -> layout folder. The file names would be _slide_1.xml etc.,

  • Rachana Patil

    I am not getting that intro slides after i run my code it simply show my main activity not the intro slides..please help me in this..

    • Luca Chirichella

      …setTypeface ok.
      But it’s the connection I do with textview in “instantiateItem” that does not go.
      I’m wrong here “text_slide_1 = (TextView) view.findViewById”
      I can not understand how to link the textview of each slide to the layout in MyViewPagerAdapter.
      Sorry for the trouble, thank you.

      • Post you complete activity code somewhere. May be on gist. I’ll check once.

  • jiyathomas

    I am not getting that intro slides after i run my code it simply show my main activity not the intro slides..ii want open the slider when open app again not by pressing any button …please help me in this..

  • erlangga deva

    why when i add 1 slide, the app going force closed. i already added layout in welcomeactivity.java

    i hope you answer my question

  • Dave Manuel

    I follow your steps but when I tried to run its unfortunately stop I view the logs and it says
    “You need to use a Theme.AppCompat theme (or descendant) with this activity”

    How can fix it? Thanks!

    • It’s may be because of using getApplicationContext() or this in the app when context is needed. Try toggling the code and run the project.

      • Dave Manuel

        I try to download your code and works good, but when I try it to follow it is error. In what file is that? Thank you!

        • Whats the theme applied to your activity in AndroidManifest.xml? Cross check it with my code.

          • Dave Manuel

            okay I will. by the way in your code what is your min and max target API?

  • Rachana Patil

    Sir…how https://uploads.disquscdn.com/images/8606a6e25c7bc2217f31b067251bcd46b737025da07b21a534505b94df6dac36.png can I change the bottom of the slider like this picture(zig-zag border)..I dis search a lot..but couldn’t get this

    • You can use custom view and draw on canvas may be using a for loop.

  • Byron De Juan

    hi sir can you update this tutorial to something like this?
    the position of button and the blending of colors when switching, i want that kind of design 🙂
    https://uploads.disquscdn.com/images/3a068de62309a3c61f3e7d1b52543332fcea3d304816c9d5b1b3d9bb1bf6e50a.gif

    • Hi Byron

      Tutorial can’t be modified because of ones requirement. You have to use your knowledge to do required changes.

      • Byron De Juan

        ok sir i understand thank you 😉

  • Sushil Kumar

    Thanks for this gr8 tutorial..

  • Saathwik Nalige

    how can i do this using fragmentstatepageradapter?

  • Generally its not preferred. But using some hacks you can do it. Whats the action after the login (on webpage) or what response it gives.