可以通过aa工具传递自定义参数,在onCreate时通过want获取自定义参数,存储在LocalStorage中,在onWindowStageCreate时获取LocalStorage中的参数值,传递给windowStage.loadContent。命令行执行hdc shell aa start -a EntryAbility -b com.example.myapplication --ps targetPage pages/Page1这里通过aa工具的--ps参数,传递key为targetPage,value为 pages/Page1的键值对给want,在onCreate中能解析到其他形式的参数,可参考aa工具文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...
可以通过aa工具传递自定义参数,在onCreate时通过want获取自定义参数,存储在LocalStorage中,在onWindowStageCreate时获取LocalStorage中的参数值,传递给windowStage.loadContent。
命令行执行hdc shell aa start -a EntryAbility -b com.example.myapplication --ps targetPage pages/Page1
这里通过aa工具的--ps参数,传递key为targetPage,value为 pages/Page1的键值对给want,在onCreate中能解析到
其他形式的参数,可参考aa工具文档:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...