cost 241 ms
如何搜索配对设备 Kotlin Android App

[英]How to search paried devices Kotlin Android App

我正在尝试创建一个 Android 应用程序来连接到 HC-05 蓝牙模块。 我正在浏览Android 文档,但是,按照文档,我收到一个我无法解决的错误。 我不明白如何列出绑定设备。 我在“= BluetoothAdapter.bondedDevices”处收到错误。 我正在尝试获取绑定到 And ...

Lottie Animation 不适合 Android 设备上的屏幕高度

[英]Lottie Animation not fit screen height on Android device

我正在使用 Lottie animation 但 animation 区域(高度)仅达到屏幕的一半,即使我的 LottieAnimationView 使用 0dp 来匹配父级。 我不确定这是动画 JSON 问题,在 JSON 中,宽度为 768,高度为 1500,我使用像素 6,即 dp 412 x ...

Kotlin 红色警告码

[英]Kotlin Red Warning Codes

请从我的 kotlin 代码中给我这个问题的解决方案! t.message 有红色警告 binding.root 有红色警告我试图解决这个问题,但仍然没有成功。 ...

2023-01-27 04:11:53   1   26    kotlin  
在 log4j2 上使用 slf4j 在 springboot 中记录结构化键值对

[英]Logging structured key-value pairs in springboot with slf4j over log4j2

我正在开发一个 Kotlin spring-boot 项目,该项目在 log4j2 上使用 slf4j,我想以键值对的方式登录,以便将基于键的过滤器添加到我正在使用的数据分析器 (splunk)。 根据应该可以使用 fluent-api 的 slf4j文档,但只能从 2.0.0 版开始使用,并且该项 ...

如何安全地处理试图访问不存在的内容的 firebase get 方法

[英]How to safely deal with a firebase get method trying to access something that doesn't exist

在我当前的项目中,我有一个部分,用户基本上输入一个密钥以获取 firebase 中该密钥下的数据。我正在使用 get 方法,因为它只需要访问一次。 get 方法有一个 on Success 和 on failure 侦听器,我在 try catch 块中拥有整个东西,但由于某种原因,应用程序仍然会 ...

Jetpack Compose 导航正在触发重组

[英]Jetpack Compose Navigation Is Triggering Recomposition

我有一个使用Navigation Component的简单 Jetpack Compose 应用程序。 我的 UI 由以下可组合项组成(为简洁起见,经过编辑的 UI): 导航主机: 一些清单: 物品卡: 现在,每当用户单击 ItemCard 时,他/她都会转换到 ItemView。 我看到的是 It ...

我无法使用 R.layout.(file_name) 在我的适配器中访问我的布局文件

[英]I can't reach my layout file in my adapter with R.layout.(file_name)

我正在尝试添加自定义布局以更改我在微调器中选择的项目文本。 但是我无法在我的阵列适配器中使用 R.layout.my_selected_item 访问我的布局文件。 它说“未解决的参考:my_selected_item”。 您可以在此处看到错误: 数组适配器: 我的_selected_item: 我 ...

intellij IDEA调试模式:线程“main”中的异常java.lang.ClassNotFoundException:kotlinx.coroutines.debug.AgentPremain

[英]intellij IDEA debug mode: Exception in thread "main" java.lang.ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain

我正在使用智能: 架构是aarch64 。 我正在使用基于 Apple M1 Pro的 MacBook Pro,MacOS 版本为13.1 (22C65) 。 我的项目是基于spring boot的,我可以像往常一样运行它。 但是当我在调试模式下运行项目时,我面临以下错误: 连接到目标VM,地址: ...

如何在recyclerview中排列cardview的颜色

[英]how to arrange color of cardview in recyclerview

enter image description here当我点击卡片视图时,我希望其他卡片视图颜色变为白色这里的设计是我在 recyclerview 中展示的 我列出的带有 recyclerview 适配器代码的块我无法理解 setOnclickListener 中的逻辑,我不知道如何制作算法 ...

Kotlin -> Java API 调用未使用我想要的方法,因为可变参数方法正在吞噬所有方法 arguments

[英]Kotlin -> Java API call is not using the method I want because varargs method is swallowing all method arguments

我从 Kotlin 调用 Spring 方法,Spring 提供 2 个签名,一个需要 2 个参数(第二个是可变参数),另一个需要 3 个参数。 我想调用 3-arg 方法,但我无法弄清楚如何匹配类型 - 它一直调用 2-arg 版本,可变参数吞噬值。 这是方法签名(我想调用第一个,但它一直在调用 ...

2023-01-26 16:36:20   2   40    java / kotlin  
任务 ':app:checkReleaseDuplicateClasses' 执行失败

[英]Execution failed for task ':app:checkReleaseDuplicateClasses'

我的 react-native android 构建中突然出现构建问题。 令人惊讶的是它是在早上建造的,没有做任何改变,但突然,它失败了。 这是我得到的错误。 知道为什么会这样吗? 确实在堆栈和 GitHub 中也看到了一些类似的问题,但到目前为止,这些问题中建议的任何修复对我都不起作用。 似乎这些 ...

Jetpack 撰写如何跳过 LazyVerticalGrid / java.lang.IllegalStateException 中的一项:检查失败

[英]Jetpack compose how to skip one item in a LazyVerticalGrid / java.lang.IllegalStateException: Check failed

我开始使用 Jetpack Compose。 我正在创建一个网格来显示一些带有一些文本的框。 问题是我从我的 api 获取数据,有些可能是 null。所以我想跳过我的网格中的这个项目,但它不起作用。 这是我的代码: 我从 api 得到的结果是一个带有多个字符串的 object,标题是其中之一,我需要 ...

Android Kotlin 观察者未检测到 LiveData 更改

[英]Android Kotlin Observer not detecting LiveData Change

我有一个简单的 Android Kotlin 应用程序,我正在使用它涉及与一个 viewModel 通信的多个片段。 问题是我的第一个片段中的 LiveData 观察器不会在我视图 model 中的列表每次更改时更新。任何人都可以解释我可能哪里出错了吗? 这是我的片段: 这是我的视图模型: } 我 ...

防止片段class被实例化和继承(Android)

[英]Preventing a Fragment class from being instantiated and inherited (Android)

我想为某些片段强制执行工厂模式,因为根据这个问题,这是将数据传递给片段的 go 的方式。 但是,为了强制执行它,我必须阻止实例化该片段。 根据这个问题,这样做的方法是将构造函数设为私有。 问题是我收到此错误: could not find Fragment constructor 根据这个问题, ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM