gpt4 book ai didi

android - 如何使用 Intent 打开 Gmail 登录 Activity

转载 作者:行者123 更新时间:2023-12-02 02:40:17 24 4
gpt4 key购买 nike

我想使用 Intent 直接从另一个应用程序打开 Gmail 登录 Activity 。我可以使用其名称com.google.android.gm 打开gmail 应用程序。但我想知道如何直接打开其登录 Activity ,因为 Activity 如下所示

enter image description here enter image description here

  1. 这些 Activity 的 URI 是什么?或者
  2. 如何获得这些 URI?

最佳答案

您在此处提供的屏幕截图不是 Gmail Activity 的一部分,而是它本身的 Android 操作系统的一部分,称为 AccountManager

检查 here了解更多信息

现在是主要答案:-

正如您指定要通过您的 Intent 启动这些,您可以这样做

//pass the action while creating intent
Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);

//setting type for Google Accounts
intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[] {"com.google"});

startActivity(intent);

关于android - 如何使用 Intent 打开 Gmail 登录 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59999240/

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