javacodegeeks.com

Restart Android Activity with ActivityScenario

I was writing an instrumentation test which required restarting the activity during a test. As I was trying out the ActivityScenarioRule to replace an ActivityTestRule, the documentation says I can use this method on the ActivityScenario to restart the activity after it has been launched:1scenario.recreate()So I wrote this function to for restarting the activity:[email protected]    @JvmField var rule = ActivityScenarioRule(MyActivity::class.java)

javacodegeeks.com

Gradle Dependencies for Java, use compile or implementation?

While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of the examples were using the compile configuration for dependencies, while others were using implements and api.dependencies { compile 'commons-httpclient:commons-httpclient:3.1' compile 'org.apache.commons:commons-lang3:3.5' }dependencies { api 'commons-httpclient:commons-httpclient:3.1' implementation 'org.apache.commons:commons-lang3:3.5' }This