In my application, after entering the system, an account creation section is created, which is usually used to synchronize application data with deleted data.
But if the phone is in a state of instability, it will not create an account, and AccountManager.addAccountExplicitly returns false. But when I check the account [], it returns the length as 1
AccountManager accountManager = AccountManager.get(this); Account[] accounts = accountManager.getAccountsByType("com.sample.account"); if (accounts.length == 0) { addAccountAndSync(); }
But the application does not appear in the "Accounts" section in the phone settings. Has anyone encountered this situation.
source share