转换为 AndroidX
并收到已弃用警告:import androidx.test.InstrumentationRegistry
。
如果我使用下一个导入:import androidx.test.platform.app.InstrumentationRegistry
,我将无法使用 getContext()
。
例如:val context = InstrumentationRegistry.getContext()
。
在 build.gradle
中:
androidTestImplementation 'androidx.test.ext:junit:1.0.0-beta02'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androix.test.platform.app
包的InstrumentationRegistry
。 - woprandi