Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

On Resume Activity Crash #97

Open
IgnaGarcia opened this issue Feb 10, 2022 · 2 comments
Open

On Resume Activity Crash #97

IgnaGarcia opened this issue Feb 10, 2022 · 2 comments

Comments

@IgnaGarcia
Copy link

if the app goes to background and resume it crash on resume picker.

Code:

        val titles = resources.getStringArray(R.array.interests)
        binding.picker.adapter = object : BubblePickerAdapter {

            override val totalCount = titles.size

            override fun getItem(position: Int): PickerItem {
                val lightBlue = getColor(R.color.ligth_blue)
                val violet = getColor(R.color.violet)
                val black = getColor(R.color.black)
                val white = getColor(R.color.white)

                return PickerItem().apply {
                    title = titles[position]
                    gradient = BubbleGradient(lightBlue, violet, BubbleGradient.HORIZONTAL)
                    textColor = black
                    overlayAlpha = 0.8f
                }
            }
        }

        binding.picker.listener = object : BubblePickerListener {
            override fun onBubbleSelected(item: PickerItem) {
                item.title?.let { Log.e("SELECT", it) }
            }

            override fun onBubbleDeselected(item: PickerItem) {
                item.title?.let { Log.e("UNSELECT", it) }
            }
        }

        binding.picker.bubbleSize = 20
    override fun onResume() {
        super.onResume()
        binding.picker.onResume()
    }

    override fun onPause() {
        super.onPause()
        binding.picker.onPause()
    }

Exception:
image

im doing something bad? how i fix it?

Thanks!

@Varenie
Copy link

Varenie commented Feb 21, 2022

I'm not sure that my decision is correct, but it helped me to remove these lines in the Engine file.kt (I downloaded the project from GitHub)
image

UPD: But this stops removing the balls, which is why they become invisible and interfere with the progress of visible balls

@hamidovmurad
Copy link

I'm not sure that my decision is correct, but it helped me to remove these lines in the Engine file.kt (I downloaded the project from GitHub) image

UPD: But this stops removing the balls, which is why they become invisible and interfere with the progress of visible balls

This solved my problem. code working stable
Screen Shot 2022-09-21 at 09 19 53

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

No branches or pull requests

3 participants