今天在用robotium对FragmentActivity 测试的时候提示类找不到异常
折腾了半天,最后找到解决方案,把android-support-v4选中去掉就行了.
基类封装
public abstract class BaseInstrumentationTestCase<T extends FragmentActivity> extends ActivityInstrumentationTestCase2<Activity>{ protected Solo solo; @SuppressWarnings({ "rawtypes", "unchecked" }) public BaseInstrumentationTestCase(Class<T> activityClass) { super(((Class)activityClass)); } @Override protected void setUp() throws Exception { solo = new Solo(getInstrumentation(), getActivity()); super.setUp(); } @Override protected void tearDown() throws Exception { solo.finishOpenedActivities(); super.tearDown(); } }
时间: 2024-11-08 17:26:17