From 730b307b12baa6db25bed55db9d256da960a1830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BA=86=E6=B3=89?= Date: Tue, 18 Oct 2022 15:36:28 +0800 Subject: [PATCH] Update uts-for-android.md --- docs/plugin/uts-for-android.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/plugin/uts-for-android.md b/docs/plugin/uts-for-android.md index 1eaa5bd43..0dd29ef2a 100644 --- a/docs/plugin/uts-for-android.md +++ b/docs/plugin/uts-for-android.md @@ -404,6 +404,30 @@ System.currentTimeMillis() ``` +### 4.9 UTS 不建议使用 快捷构造 + +`kotlin` 中 支持通过()的方式,快速实现无参构造器的声明 + +```kotlin +// 获取当前时间戳 +class ScreenReceiver extends BroadcastReceiver(){ + +} +``` + + +UTS环境中,不建议这样做(虽然目前这样做不会影响编译),建议使用手动声明无参构造 + +```ts +class ScreenReceiver extends BroadcastReceiver{ + + constructor (){ + super(); + } + +} +``` + ## 5 常见问题(持续更新) -- GitLab