Settings intent

attenzi0ne

Member
Licensed User
Longtime User
Hello guys

I am trying to invoke the "ADD_ACCOUNT" intent inorder to add a google account but I get the following error:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.ADD_ACCOUNT flg=0x20000 }

and this is my code:

B4X:
   Dim DoAction As Intent
      DoAction.Initialize("android.settings.ADD_ACCOUNT", "")
      StartActivity(DoAction)
      Return

what is the proper way of doing this?
 

attenzi0ne

Member
Licensed User
Longtime User
thanks for your reply
i got the following error, do i need to declare anything in the manifest?

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.settings/com.android.settings.accounts.AddAccountSettings}; have you declared this activity in your AndroidManifest.xml?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
The code I posted applies to SDK 17, on older versions it might be different, but the process will be the same, just a different intent name; check the unfiltered logs to get the correct one.
 
Upvote 0
Top