Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Dúvida BroadcastReceiver

Sim, adicionada. Até fiz coisas duplas pelo jeito, registrando novamente no MainActivity, não devo?

On Tue, Jul 26, 2016 at 7:26 PM, Fernando Cesar da Silva <eng.fernandocesar@gmail.com> wrote:
Você adicionou a permissão?

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

Abraço.

2016-07-26 16:51 GMT-03:00 Arthur Ruppenthal <arthur.ruppenthal@gmail.com>:
Olá pessoal.

Por que o sistema pode não estar entrando no onReceive da minha classe TratadorBroadcast?

Classe:

public class TratadorBroadcast extends BroadcastReceiver {

@Override
public void onReceive(Context aContext, Intent aIntent) {
if (aIntent.getAction().toString().contains("BOOT_COMPLETED")){
Intent i = new Intent();
i.setAction("com.atc.barcodereaderpa.SincronizarService");
aContext.startService(i);
Log.i(this.getClass().getName(),"onReceive()");
}
}
}

Manifest:    
<receiver android:name=".TratadorBroadcast">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

</receiver>
Agradeço desde já!

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



--
Atenciosamente,

Fernando Cesar da Silva
Eng° da Computação
Skype: eng.fernandocesar

PRESERVE O MEIO AMBIENTE SÓ IMPRIMA ESTE E-MAIL SE FOR INDISPENSÁVEL.

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