gpt4 book ai didi

android - Activity 家长

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:01 26 4
gpt4 key购买 nike

有人能说出为什么在使用 startActivity(intent) 开始 Activity 时,在新的 onCreate() 中调用 getParent()创建的 Activity 返回 nul ?

另外,我怎样才能获得以这种方式创建的 Activity 的父级?能否获取Activity栈中当前Activity下Activity的引用?

最佳答案

Can someone tell if why when starting an activity with startActivity(intent) , calling getParent() in onCreate() of the new created activity returns a nul ?

因为 Activity 没有父级。父 Activity 的概念仅由 ActivityGroup 使用。

Can a reference of the activity below the current activity in the activity stack be obtained ?

不,对不起。

关于android - Activity 家长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2590710/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com