我想直接使用 Intent 从另一个应用程序打开 Gmail登录活动。我可以使用其程序包名称 com.google.android.gm 打开 gmail应用程序。但是我想知道如何直接打开其“登录活动”,如下所示。
答案 0 :(得分:1)
您在此处提供的屏幕截图不是Gmail活动的一部分,而是Android操作系统本身的一部分,称为AccountManager
。
选中here可以了解更多信息
现在是主要答案:-
正如您指定要通过意图启动它们一样,您可以执行
//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);