Boa tarde,
Att,
-- Estou tentando pegar o nome, e-mail e telefone do celular do dono, para preencher um formulário automaticamente.
Para o número tentei com isso aqui:
TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String number = tm.getLine1Number();
Mas o mesmo me devolve sempre vazio,
Alguém poderia dar um help?
Consegui pegar apenas o e-mail por enquanto.
AccountManager accountManager = AccountManager.get(getActivity().getBaseContext());
Account[] accounts = accountManager.getAccountsByType("com.google");
((TextView) view.findViewById(R.id.edtContactEmail)).setText(accounts[0].name);
Jhosef Marks de Carvalho
Celular: (47) 9708-6420
skype: jhosef.marks
Twitter: @jhosefmarks
Twitter: @jhosefmarks
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
0 comentários:
Postar um comentário