开发者

How to get default email account information in android..?

I am developing an application which requires to auto populate a default email field. The logical choice is to retrieve the email address from the email client provided by android. I sear开发者_Go百科ched the content providers and did not find anything about the email client. How is this information stored? How can I reach it?


Try this:

AccountManager accManager = AccountManager.get(context);
Account acc[] = accManager.getAccounts();
int accCount = acc.length;
AppConstants.accOnDevice = new Vector<String>();
for(int i = 0; i < accCount; i++){
//Do your task here...
}

Permission:

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜