我有以下代码:
``` Html.fromHtml(getString(R.string.privacy_policy_text) ```
然而,`Html.fromHtml()`被弃用了。我知道应该使用`HtmlCompat`,如此处所示。但是,尽管进行了很多搜索,我仍不知道需要在我的build.gradle文件中包含哪些内容才能使该类可用。
我已经在我的build.gradle中拥有以下支持库:
``` Html.fromHtml(getString(R.string.privacy_policy_text) ```
然而,`Html.fromHtml()`被弃用了。我知道应该使用`HtmlCompat`,如此处所示。但是,尽管进行了很多搜索,我仍不知道需要在我的build.gradle文件中包含哪些内容才能使该类可用。
我已经在我的build.gradle中拥有以下支持库:
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation "androidx.core:core:1.0.0-beta1"
。但是,我注意到转移到androidx
并不容易。在build.gradle
的dependencies
列表中,我们通过implementation
或类似语句添加到项目中的库或其他内容称为“Artifact”。 - CommonsWare