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

IllegalArgumentException not attached to window manager #19

Open
paulpv opened this issue Sep 5, 2019 · 1 comment
Open

IllegalArgumentException not attached to window manager #19

paulpv opened this issue Sep 5, 2019 · 1 comment

Comments

@paulpv
Copy link

paulpv commented Sep 5, 2019

View=DecorView@9cb1f85[HomeActivity] not attached to window manager
android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:533)
android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:433)
android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:124)
android.app.Dialog.dismissDialog (Dialog.java:518)
android.app.Dialog.dismiss (Dialog.java:501)
com.vorlonsoft.android.rate.AppRate.dismissRateDialog (AppRate.java:663)
com.vorlonsoft.android.rate.AppRate.showRateDialog (AppRate.java:628)
com.vorlonsoft.android.rate.AppRate.showRateDialogIfMeetsConditions (AppRate.java:118)
com.....HomeActivity.onCreate (HomeActivity.kt:330)

The above is happening for less than 1% of my users.

Here is my Activity's code:

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        if (isFinishing) {
            return
        }

        // https://github.com/Vorlonsoft/AndroidRate#micro-configuration
        @Suppress("SimplifyBooleanWithConstants")
        AppRate.with(this)
                .setInstallDays(7)
                .setLaunchTimes(10)
                .setRemindInterval(3)
                .setRemindLaunchesNumber(10)
                .setMessage(R.string.pb_rate_dialog_message)
                .setDebug(true && BuildConfig.DEBUG)
                .setOnClickButtonListener { which ->
                    run {
                        PbLog.d(TAG, "AppRate.OnClickButtonListener(which=$which)")
                        val result = when (which.toInt()) {
                            DialogInterface.BUTTON_POSITIVE -> {
                                "RateNow"
                            }
                            DialogInterface.BUTTON_NEUTRAL -> {
                                "Later"
                            }
                            DialogInterface.BUTTON_NEGATIVE -> {
                                "Never"
                            }
                            else -> {
                                "UNKNOWN($which)"
                            }
                        }
                        val phoneModelName = PbPlatformUtils.getDeviceName()
                        hiveManager!!.analyticsManager.appRatePromptButtonClicked(result, phoneModelName)
                    }
                }
                .monitor()
        if (AppRate.with(this).storeType == StoreType.GOOGLEPLAY) {
            if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING) {
                AppRate.showRateDialogIfMeetsConditions(this)
            }
        } else {
            AppRate.showRateDialogIfMeetsConditions(this)
        }

        setContentView(R.layout.activity_home)

        ...
    }
@paulpv
Copy link
Author

paulpv commented Sep 6, 2019

I am running 1.2.1, released Sep 13, 2018:
https://github.com/Vorlonsoft/AndroidRate/releases/tag/1.2.1.Osaka

It seems like @AlexanderLS commited a fix for this on Nov 6, 2018:
803361f

If you released that version live then that should stop my few users from crashing.

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

1 participant