[英]Communication between Android native and Trusted Web Activity(TWA)
[英]Trusted Web Activity [TWA] - Can it read AccountManager accounts on Android?
LauncerActivity
在 Android 中读取通过AccountManager
API 创建的帐户。我已确认我在设备上有帐户,并正在尝试将所有帐户打印到 Logcat,但没有返回任何结果:
private void printAccounts() {
Account[] accounts = AccountManager.get(this).getAccounts();
Log.d("FoundAccount", "Total accounts: " + accounts.length);
for (Account account : accounts) {
Log.d("FoundAccount", ": " + account.name);
}
}
通过 Logcat 生成 output:
D/FoundAccount: Total accounts: 0
任何资源将不胜感激,谢谢!
在预先存在的 Android 应用程序中运行完全相同的代码后,立即为 Google 和自定义第三方帐户提取了这些帐户。 可以肯定地说 TWA 不存在此功能......如果其他人有任何指向此文档的链接,我会说这仍然是相关信息,但为了回答这个问题以供其他寻求答案的人回答同样的问题......答案是否定的,这个功能是不可能的,至少目前是这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.