Android Question how to delete accounts programmatically

fransvlaarhoven

Active Member
Licensed User
Longtime User
Hello,

I want to go directly to a screen where I can delete an account from the Phone.

Something similar to i.Initialize("android.intent.action.DELETE", "package:" & packagename)

but then for an account.

Is this possible?

And is there a place where I can find all the intents for doing such things?
 

NJDude

Expert
Licensed User
Longtime User
You cannot delete accounts programmatically, but you can open the "Accounts" activity.

B4X:
Private i As Intent
	
i.Initialize("", "")
i.SetComponent("com.android.settings/.Settings$AccountSettingsActivity")
	
StartActivity(i)

There's no place where you can find all possible intents, you will have to use the app and look at the logs and see the intents being sent.

Some common intents are documented, but most like the ones you mentioned need to be researched.
 
Last edited:
Upvote 0

Zockolade

Member
Licensed User
Longtime User
This doesn't work for me. Is there any change from Android?

Tested on a Samsung Tab Active 2 with Android 9
 
Upvote 0

Zockolade

Member
Licensed User
Longtime User
It is a B4A Code!

You should ALWAYS start a new thread instead of posting to years old threads.

Ok I understand... but this b4a code doesn't work for me on a Samsung Tab with Android 9.

B4X:
Private i As Intent
    
i.Initialize("", "")
i.SetComponent("com.android.settings/.Settings$AccountSettingsActivity")
    
StartActivity(i)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…