How to use ActivityTestRule when launching activity with bundle?
问题 I am using val activityRule = ActivityTestRule(SingleFragmentActivity::class.java, true, true) and SingleFragmentActivity is a test helper activity class I used from google GithubBrowseSample how can I launch activity with bundle ? 回答1: You can get activity from activityRule and you can set extra data for intent activityRule.activity.intent.putExtra("key",value) 回答2: There are 2 ways of achieve what you would like to. First one, unfortunately, require creating custom ActivityRule , which will