Você passa um objeto de activity em activity tudo bem, mas o contexto você pode acessar a qualquer momento. Não é necessário passar via extra.
Afinal, se a tua última activity, que faz a persistência, está rodando, ela já tem o contexto!
Att.
--
Carlos Eduardo Simões Pelegrin
Em 8 de março de 2014 20:48, Thiago Silva <thiagodd.silva@gmail.com> escreveu:
Eu vou passando uma classe de activity em activity, em cada uma essa classe recebe certos dados. Na última eu vou persistir esses dados no banco de dados.A classe que faz a persistência dos dados precisa do Context.--2014-03-08 19:25 GMT-03:00 Carlos Eduardo <carloseduardopelegrin@gmail.com>:
qual motivo de precisar receber o context?
--
Carlos Eduardo Simões PelegrinEm 8 de março de 2014 16:14, Thiago Silva <thiagodd.silva@gmail.com> escreveu:Eu não preciso passar nela. Mas uma outra Classe que é atributo dela tem um objeto desse nela.Se eu deixar null até a hora que realmente precisar, seria mais correto?2014-03-08 16:11 GMT-03:00 luciofm <luciofm@gmail.com>:Então você não precisa passar ele...Lúcio Maciel
luciofm@gmail.com2014-03-08 15:59 GMT-03:00 Thiago Silva <thiagodd.silva@gmail.com>:O da aplicação mesmo, que eu pego com getApplicationContext().2014-03-08 15:41 GMT-03:00 luciofm <luciofm@gmail.com>:
Que tipo de Context você está tentando passar entre Activities???--Lúcio Maciel
luciofm@gmail.com2014-03-08 15:11 GMT-03:00 Thiago Silva <thiagodd.silva@gmail.com>:--Pessoal,Preciso passar uma Classe entre umas Activity. O problema e que essa Classe tem um atributo Context. Quando tento passar a Classe no extra da Intent da erro falando que tem algum objeto que não é serializable.Tem como eu corrigir esse problema sem tirar o atributo Context da minha Classe?--Att.Thiago SilvaDesenvolvedor - Rerum Engenharia de Sistemas.
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.
--Att.Thiago SilvaDesenvolvedor - Rerum Engenharia de Sistemas.--
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.
--Att.Thiago SilvaDesenvolvedor - Rerum Engenharia de Sistemas.--
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.
--Att.Thiago SilvaDesenvolvedor - Rerum Engenharia de Sistemas.
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.






0 comentários:
Postar um comentário