How do you get the Android's primary e-mail address(play store mail id)

ShumzShumz INMember ✭✭

i am developing an application in which i need user's mail id to be fetch from his mobile device and display it in edittext but i don't have any idea how can we do it. as i am new in xamarin.android so can anyone suggest me the best possible and easy way to do this.

Posts

  • ChristopheBERNARDChristopheBERNARD BEMember ✭✭✭✭

    you have the chance that the teacher is on late

    `
    Android.Accounts.AccountManager account = Android.Accounts.AccountManager.Get(ctx) ;
    Android.Accounts.Account[] tabAccount = account.GetAccountsByType("com.google");

            //
            List<Android.Accounts.Account> list = new List<Android.Accounts.Account>();
    
            //
            foreach (Android.Accounts.Account act in tabAccount)
            {
                string name = act.Name;
                list.Add(act);
            }
    

    `

    hope this help

  • ShumzShumz INMember ✭✭

    thank you but it is already solved.

Sign In or Register to comment.