Can't even implement the AppIntro
See original GitHub issueThe 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for eveything, the AppIntro is now looking great thanks to you 😄
So your code has multiple problems that the IDE is already telling you:
onDonePressed
You have the
onDonePressed
function defined twice in you code. You must remove one of the two functions.onSkipPressed
You’re referencing
MainActivity.this
while your activity is calledAppIntroActivity
. So you should change youronSkipPressed
code to:SliderPage
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).