由RegisterPageAbilitySlice 跳转到 MainAbilitySlice
需要以下几步 首先在RegisterPageAbilitySlice 用
//获取对应控件 findComponentById(ResourceTable.Id_btn_listcontainer) //点击事件跳转到对应Ability btn_listcontainer.setClickedListener(new Component.ClickedListener() { @Override public void onClick(Component component) { Intent intent = new Intent(); Operation operation = new Intent.OperationBuilder() .withDeviceId("") .withBundleName("com.example.myapplication2res") .withAbilityName("com.example.myapplication2res.MainAbility") .build(); intent.setOperation(operation); startAbility(intent); } });
跳转到Ability后会通过super转到对应AbilitySlice
AbilitySlice 在onStar方法
super.setUIContent(Resour