Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Pegar número, telefone e e-mail

Também to achando isso Ernani, vi que o pessoal usa um método alternativo, pega a lista de contato e varre procurando um contato com o mesmo e-mail e pega o telefone e nome.

Vou ver se faço isso.


Att,


Jhosef Marks de Carvalho
Celular: (47) 9708-6420
skype: jhosef.marks
Twitter: @jhosefmarks

Em 25 de setembro de 2014 22:52, Ernani Joppert Pontes Martins <joppert@gmail.com> escreveu:
Me parece que isso varia muito de aparelho e alguns não permitem isso,
pois creio que a restrição esteja no nível do sim card.

Pelo menos foi o que eu entendi lendo sobre o assunto.

[]'s

Ernani

On Thu, Sep 25, 2014 at 7:15 PM, Jhosef Marks <jhosef@gmail.com> wrote:
> Boa tarde,
>
> 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);
>
> Att,
>
>
> Jhosef Marks de Carvalho
> Celular: (47) 9708-6420
> skype: jhosef.marks
> 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.

--
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.

--
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.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário