in some phones (in a certain "oneplus" android v6.0.1 to be exact) . I'm getting No Activity found to handle Intent { act=android.settings.ADD_ACCOUNT_SETTINGS (has extras) }
error when I try to call up the account add screen with what seemed to be the "right" way.
Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, new String[]{Constants.ACCOUNT_TYPE});
startActivity(intent);
I can seemingly add
<intent-filter>
<action android:name="android.settings.ADD_ACCOUNT_SETTINGS" />
</intent-filter>
to my login activity, but should I even do that? if so why is it working on most phones but crashing on one. I want my account intent to go through as if the user is trying to create an account through the phone's settings screen and this seems like a bad shortcut.
I finally found the problem. apparently the phone which I addressed was running on a cyanogen and for whatever reason where other android 6 phones (and emulator) did not require GET_ACCOUNT permission for a request for my own application's account, this phone did.
the error says nothing about lacking permission however after acquiring GET_ACCOUNT with run-time request, it functions as expected.