question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't even implement the AppIntro

See original GitHub issue

The erros that I have don’t allow me to even run the program:

**I tried to use the code they give us in the AppIntro and even tried some variations from some youtube tutorials but all give me errors **:

package com.example.biscates;

import android.content.Intent;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;

public class AppIntroActivity extends AppIntro {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        addSlide(AppIntroFragment.newInstance("Hey", "description", R.drawable.testingImage4, Color.BLUE));
        // Note here that we DO NOT use setContentView();

        // Add your slide fragments here.
        // AppIntro will automatically generate the dots indicator and buttons.

        // Instead of fragments, you can also use our default slide.
        // Just create a `SliderPage` and provide title, description, background and image.
        // AppIntro will do the rest.
        SliderPage sliderPage = new SliderPage();
        sliderPage.setTitle(title);
        sliderPage.setDescription(description);
        sliderPage.setImageDrawable(image);
        sliderPage.setBgColor(backgroundColor);
        addSlide(AppIntroFragment.newInstance(sliderPage));

        // OPTIONAL METHODS
        // Override bar/separator color.
        setBarColor(Color.parseColor("#3F51B5"));
        setSeparatorColor(Color.parseColor("#2196F3"));

        // Hide Skip/Done button.
        showSkipButton(false);
        setProgressButtonEnabled(false);

        // Turn vibration on and set intensity.
        // NOTE: you will probably need to ask VIBRATE permission in Manifest.
        setVibrate(true);
        setVibrateIntensity(30);
    }

    @Override
    public void onDonePressed(Fragment currentFragment){
        super.onDonePressed(currentFragment);
        Intent intent = new Intent(getApplicationContext().MainActivity.class);
    }

    @Override
    public void onSkipPressed(Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        Toast.makeText(MainActivity.this, "App Intro Ended", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onDonePressed(Fragment currentFragment) {
        super.onDonePressed(currentFragment);
        // Do something when users tap on Done button.
    }

    @Override
    public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
        super.onSlideChanged(oldFragment, newFragment);
        // Do something when the slide changes.
    }
}

Stack trace / LogCat:

code in the screenshots

1 2 3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Diaj3commented, May 26, 2019

Thanks for eveything, the AppIntro is now looking great thanks to you 😄

1reaction
cortinicocommented, May 26, 2019

So your code has multiple problems that the IDE is already telling you:

onDonePressed

img

You have the onDonePressed function defined twice in you code. You must remove one of the two functions.

onSkipPressed

img

You’re referencing MainActivity.this while your activity is called AppIntroActivity. So you should change your onSkipPressed code to:

    @Override
    public void onSkipPressed(Fragment currentFragment) {
        super.onSkipPressed(currentFragment);
        Toast.makeText(AppIntroActivity.this, "App Intro Ended", Toast.LENGTH_SHORT).show();
    }

SliderPage

img

The code is failing since you’re not importing the SliderPage class. Please make sure that you have those 3 lines on the top of your activity (you have only two at the moment).

import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;
import com.github.paolorotolo.appintro.model.SliderPage;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to resolve: com.github.AppIntro:AppIntro:6.1.0 #957
Describe the bug I added jitpack to my repositories and AppIntro to my dependencies, but still gradle fails to resolve it.
Read more >
Error in addSlide method in appintro in android studio
AppIntro library works best with the following import in your AppIntroSampleSlider.java file: import android.support.v4.app.Fragment;. Instead of:
Read more >
Desktop App Intro (English) | A guided tour of the intellugent cyclign ...
A guided tour of the intellugent cyclign software.
Read more >
Vadim Caen on Twitter: "@hamatro Weeeelll... You can't really use ...
Yes the first part with the Animated Vector Drawable runs in the system ui process, before your app's process is even created, which...
Read more >
react-native-app-intro-slider - npm
An easy-to-use yet very configurable app introduction slider/swiper based on FlatList that supports RTL. yarn add react-native-app-intro- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found