Android: account

Is it possible to set the topic of the selection dialog?

import com.google.android.gms.common.AccountPicker; .... String[] accountTypes = new String[]{"com.google"}; Intent intent = AccountPicker.newChooseAccountIntent(null, null, accountTypes, false, null, null, null, null); activity.startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT); 

My basic theme is android:Theme.Light , but this dialog is dark. Thanks.

+8
android google-play-services android-theme google-authenticator
source share
2 answers

If you want to change the theme of the dialog, you must change newChooseAccountIntent to zza and add two integer arguments. The first is intended to redefine the theme and set it to 1 in order to change the theme of the dialogue into the light.

 String[] accountTypes = new String[]{"com.google"}; Intent intent = AccountPicker.zza(null, null, accountTypes, false, null, null, null, null, false, 1, 0); startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT); 
+9
source share

When your Accountpicker is announced (I don't know much about AccountPicker), you can set a theme, but it is also possible that this theme calls it using the system

EDIT: there is a reason

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml

but I think you can change it :)

-2
source share

All Articles