I am planning to write a simple code which lists out all the accounts associated in my Android phone such as Facebook, Twitter, Gmail, Dropbox and so on…
AccountManager am = AccountManager.get(this);
Account [] acc = am.getAccounts();
if (acc.length > 0){
for (int i=0; i<acc.length; i++){
listedAcc = acc[i] + "\n";
}
accounts.setText(listedAcc.toString());
After running the above coding, the TextView “accounts” only shows me
Account {name=abc@hotmail.com,
type=com.android.exchange}
How I am going to do in order to list out all other accounts in my phone… Thanks…
Use a String and concatenate properly (
+=instead of=):