-
Notifications
You must be signed in to change notification settings - Fork 566
Description
// UI transfer with Bundle
private void goToShareActivityWithBundle() {
Author author = new Author();
author.setName("Margaret Mitchell");
author.setCounty("USA");
Bundle bundle = new Bundle();
bundle.putString("bookName", "Gone with the Wind");
bundle.putString("author", JsonService.Factory.getInstance().create().toJsonString(author));
UIRouter.getInstance().openUri(getActivity(), "DDComp://share/shareBook", bundle);
}
这是 Demo 中的数据传递,如果传递 List 数据,怎么传递?
@Autowired
List author;
接收数据时,这么写,编译报错:错误: 需要<标识符>
@OverRide
public void inject(Object target) {
jsonService = JsonService.Factory.getInstance().create();
SecondActivity substitute = (SecondActivity)target;
if (null != jsonService) {
substitute.children = jsonService.parseObject(substitute.getIntent().getStringExtra("children"), List.class);
} else {
Log.e("AutowiredProcessor", "You want automatic inject the field 'children' in class 'SecondActivity' , but JsonService not found in Router");
}
substitute.title = substitute.getIntent().getStringExtra("title");
}
这是编译生成的类,List.class 这个地方编译不通过,Cannot select from parameterized type