{"record":{"id":"56f87b5f6fbad3d9","repo":"slint-ui/slint","slug":"bind-context-called-while-the-slintcontext-is-stil","errorCode":null,"errorMessage":"bind_context called while the SlintContext is still alive","messagePattern":"bind_context called while the SlintContext is still alive","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/android-activity/lib.rs","lineNumber":182,"sourceCode":"        }\n    }\n\n    fn clipboard_text(&self, clipboard: Clipboard) -> Option<String> {\n        if clipboard == Clipboard::DefaultClipboard {\n            Some(\n                self.window\n                    .java_helper\n                    .get_clipboard()\n                    .unwrap_or_else(|e| javahelper::print_jni_error(&self.app, e)),\n            )\n        } else {\n            None\n        }\n    }\n\n    fn bind_context(&self, ctx: i_slint_core::SlintContextWeak, _: i_slint_core::InternalToken) {\n        let _ = self.context.set(ctx.clone());\n        let ctx = ctx.upgrade().expect(\"bind_context called while the SlintContext is still alive\");\n        let color_scheme = match self\n            .window\n            .java_helper\n            .color_scheme()\n            .unwrap_or_else(|e| javahelper::print_jni_error(&self.app, e))\n        {\n            0x10 => i_slint_core::items::ColorScheme::Light, // UI_MODE_NIGHT_NO\n            0x20 => i_slint_core::items::ColorScheme::Dark,  // UI_MODE_NIGHT_YES\n            _ => i_slint_core::items::ColorScheme::Unknown,\n        };\n        ctx.set_color_scheme(color_scheme);\n        if let Ok(accent) = self.window.java_helper.accent_color() {\n            ctx.set_accent_color(accent);\n        }\n        if let Ok(scale) = self.window.java_helper.font_scale()\n            && let Some(size) = javahelper::font_scale_to_logical_length(scale)\n        {\n            ctx.set_platform_default_font_size(Some(size));","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/slint-ui/slint/blob/3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016/internal/backends/android-activity/lib.rs#L164-L200","documentation":"Error \"bind_context called while the SlintContext is still alive\" thrown in slint-ui/slint.","triggerScenarios":"Thrown at internal/backends/android-activity/lib.rs:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop the previous SlintContext before binding a new context.","Do not call bind_context twice for the same platform."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fd8f2ec03c2aa8a95d5f4b9daa299c7b8bf4016","analyzedAt":"2026-08-19T23:23:16.610Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}