Android How to Build Intro Slider for your App

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.

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.

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.

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.

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.

Hi there! I am Founder at androidhive and programming enthusiast. My skills includes Android, iOS, PHP, Ruby on Rails and lot more. If you have any idea that you would want me to develop? Let’s talk: ravi@androidhive.info

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 🙂

It takes sometime to prepare the article for you. Meanwhile you can look into SyncAdapters, Account Authenticators and Content Provides. I know it is difficult to integrate all of them, but start learning them.

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.

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….

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 !!!!!

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?

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???

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)

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)

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

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.

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.

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?

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?

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.

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 ?

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

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.

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 😀

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.

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

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…???

i have uploaded mine xml file…i think so that in this page there is some problem…please do reply n help…

Amit Khairnar

Check logcat for the reason of force closing.

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..

In the above attachment first image is after launching , i have slided to next sreen and came back to first screen, then the dots are showing in one lane…
In the second image first time launches welcome activity Bigger dot is showing little down than the unselected dots and all dots are also showing little down…When i start i scroll to next.. All the dots will come into one lane and the layout will jump to little up… As you can see the alignment of dots ..in the first screen there is little gap in between next and dots as compared to second screen…

vinaykumar

Hi ravi, did you get any clue regarding this..

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?

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 ?

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.

…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..

Dear ! How are you. I want to make an intro with videos where we add images. Can you tell me about it.

Khawaja Ghulam Ahmad Mujtaba

Hi, I just loved your tutorial but each time, I start my app,it shows the same welcome screen…I have followed your tutorial completely but still it’s showing welcome screen every time.I am testing my application on Android 6.0. What could be the issue?

I have a scenerio…Can you suggest possible solution for it?
I want to display “Intro Slider” once in a lifetime of my app but I want to start my app from Splash Screen always. Which activity would be MAIN in manifest? Splash Screen or Intro Slider?

Hi Ravi I follow all the instructions and there seems to be a problem with my welcome screen. When it starts the next and skip button of the bottom of the screen does not show is there a way to make it visible?

Loïc Parker Amuzu

I have a button on the second slide i want to access that button
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
{
layoutInflater = (LayoutInflater)Application.Context.GetSystemService(Context.LayoutInflaterService);