标签: accountpicker

使用AccountPicker.newChooseAccountIntent选择一封电子邮件

我试图让用户使用以下代码选择一个电子邮件帐户:

Intent intent = AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"},
                            false, null, null, null, null);
                    startActivityForResult(intent, 23);
Run Code Online (Sandbox Code Playgroud)

此代码效果很好,但如果用户没有Gmail帐户,但雅虎,Hotmail等.如何通过更改第三个参数显示所有电子邮件帐户:

new String[]{"com.google"}
Run Code Online (Sandbox Code Playgroud)

非常感谢你

android android-account accountpicker

19
推荐指数
3
解决办法
1万
查看次数

通过对话框在WebView上的Google网站上授权用户

例如,用户在WebView中导航到google.com.

是否可以通过Google帐户选择器(如https://developers.google.com/android/guides/http-auth中所述)在那里授权,以简化授权,而不是通过网络表单手动登录?Android Web浏览器(例如Google Chrome)通过此方法授权用户).

android google-authentication webview accountpicker

12
推荐指数
1
解决办法
3338
查看次数

Android espresso和帐户选择器

我无法使用Espresso进行仪器测试.我有一个活动,当应用程序启动时(主要活动)弹出帐户选择器.如果客户点击取消(在对话框中),则会再次弹出选择器; 如果用户点击添加,则会在活动结果中获取结果.

我不知道如何使用espresso创建一个简单的测试,其中包括该选择器.当我使用MainActivity创建Instrumentation测试时,我收到了以下消息:阶段中没有活动RESUMED ...

public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity>{
    MainActivity myActivity;
    public MainActivityTest(){
        super(MainActivity.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        getActivity();
    }

    public void testAccountPicker(){
        onView(withText("Choose an account")).check(matches(isDisplayed()));
    }
}
Run Code Online (Sandbox Code Playgroud)

有没有人有类似的问题?

Thanx提前给你答案.

android accountpicker android-espresso

6
推荐指数
1
解决办法
3652
查看次数

如果没有帐户,AccountPicker.newChooseAccountIntent 不会显示选择器

我试图让用户使用 AccountPicker 从相同类型的自定义帐户列表中进行选择。

Intent pickAccountIntent = AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.home.customapp"}, true, null, null, null, null);
        startActivityForResult(pickAccountIntent, 1);
Run Code Online (Sandbox Code Playgroud)

我有 2 个问题:

1. 根据API,如果alwaysPromptForAccount(第 4 个参数)设置为 true,则选择器应该始终可见。

但是,如果以前没有类型为“com.home.customapp”的帐户,则即使设置alwaysPromptForAccount为 true,也不会显示选择器活动

即使没有自定义帐户,如何使选择器始终可见?

2. 如何在订单上自定义添加帐户步骤以添加自定义帐户而不是谷歌帐户?

account android accountpicker

5
推荐指数
1
解决办法
3057
查看次数