gpt4 book ai didi

android - 如何从屏幕上的某个位置启动 Activity ,例如在主屏幕或最近使用的应用程序中?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:08:46 26 4
gpt4 key购买 nike

我想在整个 Activity 中创建一个对话框的“最大化”效果,因此我希望打开动画显示 Activity 从方框扩展到全尺寸。

库存启动器自 Jelly Bean 以来就已经这样做了(按应用程序快捷方式将从该图标的位置放大到应用程序,并且自 ICS 以来“最近的应用程序”菜单已经这样做了。

最佳答案

想通了!

Bundle options = ActivityOptionsCompat.makeScaleUpAnimation(
findViewById(android.R.id.content),
findViewById(android.R.id.content).getLeft(),
findViewById(android.R.id.content).getTop(),
findViewById(android.R.id.content).getWidth(),
findViewById(android.R.id.content).getHeight()).toBundle();
startActivity(intent, options);

它只适用于 API 16 及更高版本,因此请检查它并为旧版本使用普通的旧 startActivity

关于android - 如何从屏幕上的某个位置启动 Activity ,例如在主屏幕或最近使用的应用程序中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19131972/

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