相关疑难解决方法(0)

如何用Robolectric测试碎片?

我知道有一个Robolectric.shadowOf(Fragment)方法和一个ShadowFragment类,认为它们没有在文档中列出,但我不能使它工作.

myFragment = new MyFragment();
myFragment.onCreateView(LayoutInflater.from(activity), (ViewGroup) activity.findViewById(R.id.container), null);
myFragment.onAttach(activity);
myFragment.onActivityCreated(null); 
Run Code Online (Sandbox Code Playgroud)

我正在使用API​​级别13(Honeycomb).

谢谢.

android robolectric

56
推荐指数
3
解决办法
4万
查看次数

标签 统计

android ×1

robolectric ×1