material-intro-screen icon indicating copy to clipboard operation
material-intro-screen copied to clipboard

No resource found id #0x0

Open JonathanImperato opened this issue 8 years ago • 6 comments

01-25 13:19:17.714 E/AndroidRuntime(13823): android.content.res.Resources$NotFoundException: Resource ID #0x0 01-25 13:19:17.420 E/UncaughtException(13823): at agency.tango.materialintroscreen.MaterialIntroActivity.color(MaterialIntroActivity.java:427) What is up? It crashes. Why?

JonathanImperato avatar Jan 25 '17 12:01 JonathanImperato

Please provide more details. If its possible please add snippet of your class which extends MaterialIntroActivity

bezmian avatar Jan 31 '17 11:01 bezmian

This is my intro activity:

` public class IntroActivity extends MaterialIntroActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); enableLastSlideAlphaExitTransition(true);

    getBackButtonTranslationWrapper()
            .setEnterTranslation(new IViewTranslation() {
                @Override
                public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
                    view.setAlpha(percentage);
                }
            });

    addSlide(new SlideFragmentBuilder()
                    .title("Organize your time with us")
                    .description("Would you try?")
                    .build(),
            new MessageButtonBehaviour(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    showMessage("We provide solutions to make you love your work");
                }
            }, "Work with love"));


    addSlide(new SlideFragmentBuilder()
            .title("That's it")
            .description("Would you join us?")
            .build());
}

@Override
public void onFinish() {
    super.onFinish();
    Toast.makeText(this, "Benvenuto!", Toast.LENGTH_SHORT).show();
    Intent myIntent = new Intent(IntroActivity.this, MainActivity.class);
    IntroActivity.this.startActivity(myIntent);
}}

JonathanImperato avatar Jan 31 '17 15:01 JonathanImperato

Ok got it. You need to pass buttonColor and backgroundColor via SlideFragmentBuilder(). We are aware of that issue and we will fix that in future.

bezmian avatar Jan 31 '17 15:01 bezmian

I got this error after 800 installations on the market :

Exception android.content.res.Resources$NotFoundException: Resource ID #0x0
android.content.res.Resources.getValue (Resources.java:1351)
android.content.res.Resources.getColor (Resources.java:963)
android.content.Context.getColor (Context.java:441)
android.support.v4.content.ContextCompatApi23.getColor (ContextCompatApi23.java)
android.support.v4.content.ContextCompat.getColor (ContextCompat.java)
agency.tango.materialintroscreen.MaterialIntroActivity.onFinish (MaterialIntroActivity.java)
<OR>.color (MaterialIntroActivity.java)
<OR>.access$300 (MaterialIntroActivity.java)
agency.tango.materialintroscreen.MaterialIntroActivity.showPermissionsNotGrantedError (MaterialIntroActivity.java)

at this method in MaterialIntroActivity(426):

    private int color(@ColorRes int color) {
        return ContextCompat.getColor(this, color);
    }

Note: I don't use SlideFragmentBuilder().

mehmetgunacti avatar Mar 04 '17 20:03 mehmetgunacti

Override the methods : backgroundColor() , buttonsColor() and canMoveFurther().. It's necessary...

valterh4ck3r avatar Nov 30 '17 03:11 valterh4ck3r

As there is already an issue closed with the excat same error, i guess it would be better to make those needed methods abstract?

Hatzen avatar Sep 01 '19 13:09 Hatzen