我正在使用Android Studio
。我注意到这个想法创建了一个包(没有在某些清单文件或gradle
构建文件中引用)。当我对我的MainActivity
进行测试时,一切进展顺利,但是当我想对包内的活动进行一些测试时
我收到此消息:
java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.echopen.asso.echopen/.custom.CustomActivity }
at android.app.Instrumentation.startActivitySync(Instrumentation.java:384)
at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119)
at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97)
at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104)
at com.echopen.asso.echopen.custom.CustomActivityTest.setUp(CustomActivityTest.java:19)
答案 0 :(得分:1)
您可以在清单文件中添加CustomActivity
<activity
android:name=".custom.CustomActivity">
</activity>