2011/05/26 Unable to resolve activity for: Intent错误的解决方法
来源:互联网 发布:cla共轭亚油酸 知乎 编辑:程序博客网 时间:2024/05/17 03:09
今天我继续学习编写robotium的测试程序。目标是前些天在网上下来的android的一个扫雷源码(类名为test,包名为jim.test)。我的测试程序(类名为testTest,包名为jim.test.test)。
按照昨天的学习成果我很快就建立好了一个android test application,首先在代码里用solo.searchText("000")找下扫雷程序里的一个TextView控件的文本,只是这么一个简单的代码却在执行时遇到了麻烦。问题是这样的:在我Run这个测试程序失败后,我发现提示信息Failure Trace里显示“Unable to resolve activity for: Intent”
这个错误我在上一个程序中就碰到过,只是没太在意。今天我特意上google上查了下这个错误信息(顺便BS下百度,搜这个居然什么都找不到),结果问题是出在了
public testTest(){
super("com.example.android.notepad",test.class);
}
这里面super的第一个参数我原本以为只是一个字符串,没什么实际用处,因此是直接复制的上一个程序的代码。现在才知道这个参数一定要跟本测试程序testTest的Mainfest.xml文件中的android:targetPackage 这个字段一致
<instrumentation android:targetPackage="jim.test" android:name="android.test.InstrumentationTestRunner" />
事后想想其实很明显,第二个参数是被测试程序test.class,那第一个肯定是被测试程序的包名了。
果然修改之后再Run,一切正常。
- 2011/05/26 Unable to resolve activity for: Intent错误的解决方法
- android进行单元测试时出现java.lang.RuntimeException: Unable to resolve activity for: Intent ……
- Unable to resolve superclass of错误的解决方法
- Unable to resolve superclass of错误的解决方法
- Ubuntu "sudo: unable to resolve host 主机名称"错误解决方法
- 关于在eclipse下android开发的错误:“Unable to resolve target 'android-18'"的解决方法
- 导入android项目出现:出现Unable to resolve target 'android-8'错误的解决方法
- unable to resolve ... for transcoding
- flash builder 的错误:unable to resolve resource bundle for locale en_us
- flash builder 的错误:unable to resolve resource bundle for locale en_us
- Responses to "error: unable to resolve ' ' for transcoding的解决办法
- ubuntu中unable to resolve host xxx问题的解决方法
- sudo出现 unable to resolve host xxxx的解决方法
- wget: unable to resolve host address的解决方法
- wget: unable to resolve host address的解决方法
- wget: unable to resolve host address的解决方法
- 关于Eclipse出现unable to resolve superclass错误的问题
- 运行时的“VFY: unable to resolve static field”错误
- java字符串应用之字符串编码转换
- jqgrid 设置 编辑窗体 的位置和大小的方法
- SQL数据库连接出现[错误2]与[错误17]的一个解决方法
- 建党伟业-该删的必须删
- 基于WebOSGi的Web组件化开发3——WebOSGi框架的提出
- 2011/05/26 Unable to resolve activity for: Intent错误的解决方法
- 读取置文件xxx.properties配置文件
- 一些函数指针总结(General STL BOOST)
- 7 以数据为中心的程序设计
- 颜色空间YCrCb
- linux下echo命令详解【转】
- UNIX系统常用命令
- jQuery选择器全解
- 使用GMF开发可视化界面编辑器(一)