Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity crash without errors #54

Closed
hbjosemaria opened this issue May 20, 2018 · 9 comments
Closed

Activity crash without errors #54

hbjosemaria opened this issue May 20, 2018 · 9 comments

Comments

@hbjosemaria
Copy link

My activity layout:

<LinearLayout 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:context=".Activities.ActAdelante">

    <nl.dionsegijn.konfetti.KonfettiView
        android:id="@+id/viewKonfetti"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout>

And my activity:

public class ActAdelante extends AppCompatActivity {

    private MediaPlayer mp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_act_adelante);
        mp = MediaPlayer.create(this, R.raw.best_part);
        mp.start();
        KonfettiView viewKonfetti = findViewById(R.id.viewKonfetti);
        viewKonfetti.build()
                .addColors(Color.YELLOW, Color.GREEN, Color.MAGENTA)
                .setDirection(0.0, 359.0)
                .setSpeed(1f, 5f)
                .setFadeOutEnabled(true)
                .setTimeToLive(2000L)
                .addShapes(Shape.RECT, Shape.CIRCLE)
                .addSizes(new Size(12, 5f))
                .setPosition(-50f, viewKonfetti.getWidth() + 50f, -50f, -50f)
                .streamFor(300, 5000L);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mp.stop();
        mp.release();
    }
}

Not working and also not showing any error why is crashing.

@hbjosemaria
Copy link
Author

Forgot to mention: it was on version 1.1.2.
Switched to version 1.1.1, and still not working.
Switched to version 1.1.0 and works. Is it possible that the issue is streamFor method? Or did you do some important changes?

@DanielMartinus
Copy link
Owner

Are you sure you don't see anything related to this issue in the logs? #47

@hbjosemaria
Copy link
Author

None of that. When the activity crashes it deletes all previous registers in logcat too. It's a very strange issue.

Still using version 1.1.0 fine with the expected result.

@DanielMartinus
Copy link
Owner

There were no important changes that I can think of causing this. Can you perhaps post an example project where I can reproduce this problem in order to investigate it?

@hbjosemaria
Copy link
Author

Sure, if my project was big enough to be usefull as reference, haha.

It was just 5 activities:

  • A login activity, just a button and edittext where the input is predefined in code.
  • A resume activity with a viewpager with different layouts.
  • An activity with a message which leads to the next activity (just textviews and buttons).
  • A QR code reader activity. Google vision QR code scanner.
  • And next, this activity I've shown: some views, your Konfetti and a mediaplayer.

What I said. It's just a very simple and personal project for my gf. Nothing too complicated.

Sorry if I can't help you more with this. If I use again your library and this issue repeats, I'll try to be more accurate.

@DanielMartinus
Copy link
Owner

I'll dive a bit deeper into it to see if I can find any noticeable differences that can cause this between the versions 👍

@hbjosemaria
Copy link
Author

Didn't mention it. This was tested on:

  • Huawei P8 lite.
  • Huawei p20.
  • Huawei Y6 2017.

In case it helps you in something.

@twtaya
Copy link

twtaya commented Jun 19, 2018

Good

@DanielMartinus
Copy link
Owner

I'm closing this issue, feel free to re-open if you ever come across a similar problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants