Closed MikelCalvo closed 7 years ago
The exception is very clear, the hook is not a ViewGroup, but an AppCompatImageView.
The hook view needs to be a ViewGroup so the ParticleSystem (which is a View) can be made a child of it.
The simplest ViewGroup you can use is a FrameLayout.
Hope this helps.
@plattysoft Thanks!
Hi! Today I found a way to put particles inside a Fragment (#58) but now the problem i'm dealing with is that the constructor
new ParticleSystem(ViewGroup parentView, Drawable drawable, int maxParticles, long timeToLive)
cannot be used for the displaying the particles in the background because it throws the errorandroid.support.v7.widget.AppCompatImageView cannot be cast to android.view.ViewGroup
whennew ParticleSystem(getActivity(), 50, R.drawable.animated_particles, 1000, R.id.background_hook)
Any idea of how to fix this? Thanks for your time!