作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的仪器测试的范围:
...
import androidx.test.rule.ActivityTestRule
@RunWith(AndroidJUnit4::class)
@LargeTest
class InstrumentDialogFragmentTest {
@get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java)
}
我的毕业典礼:
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:rules:1.4.0'
我收到这个警告:
'ActivityTestRule<T : Activity!>' is deprecated. Deprecated in Java
最佳答案
你仍然可以在 'androidx.test:rules:1.2.0' 上使用它。
它在 1.4.0 上已弃用。
请改用 ActivityScenario 或 ActivityScenarioRule。
查看更多:enter link description here
关于android - ActivityTestRule 在 android 测试中被弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69616702/
我是一名优秀的程序员,十分优秀!