OK. Try calling Toast from the UI thread. You can use Handler for this.
09.04.2011 14:10 пользователь "ABSOLUT" <davidtuti@gmail.com> написал:
> Yes I'm sure.
>
> I have:
>
>
> public void wakeonLan (){
> ..................................
> ....................................
> while (pruebaPing(maquina)){
> //MIENTR=AS NO RESPONDA A PING. DORMIMOS 6 SEGUNDOS EL
> PROCESO
>
> Thread.sleep(6000);
> contadorDormido=contadorDormido+6;
> Log.d("PRUEBA", "No responde a ping despues de mandar el
> paquete magico en..." + contadorDormido);
> Toast.makeText(getApplicationContext(), "No responde a
> ping despues de mandar el paquete magico en..." + contadorDormido,
> Toast.LENGTH_SHORT).show();
> Toast.makeText(this, "No esponde a ping despues de
> mandar el paquete magico en..." + contadorDormido,
> Toast.LENGTH_SHORT).show();
> Toast.makeText(ssh.this.getApplicationContext(), "No
> responde a ping despues de mandar el paquete magico en..." +
> contadorDormido, Toast.LENGTH_SHORT).show();
> ....................................
>
>
> And I can see the logcat
>
> Please any help?
> Many thanks
>
>
> On 9 abr, 11:49, Kostya Vasilyev <kmans...@gmail.com> wrote:
>> Are you sure this code actually runs, and calls Toast? Add logcat printouts
>> just before Toast to make sure.
>> 09.04.2011 13:13 пользователь "David Tabernero" <davidt...@gmail.com>
>> написал:
>>
>> > Hi,
>>
>> > I can't display Toast in my application:
>>
>> > I have this code but nothing happens. Any help please?
>>
>> > Many thanks and sorry for my english!
>>
>> > ....................
>> > ....................
>> > public void wakeonLan (){
>>
>> > try {
>> > while (pruebaPing(maquina)){
>> > Toast.makeText(ssh.this, "No responde a ping despues de
>> > mandar el paquete magico en..." + contadorDormido,
>> > Toast.LENGTH_SHORT).show();
>> > Toast.makeText(getApplicationContext(), "No responde a ping
>> > despues de mandar el paquete magico en..." + contadorDormido,
>> > Toast.LENGTH_SHORT).show();
>> > ................
>> > .................
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-developers@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+unsubscribe@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
-- > Yes I'm sure.
>
> I have:
>
>
> public void wakeonLan (){
> ..................................
> ....................................
> while (pruebaPing(maquina)){
> //MIENTR=AS NO RESPONDA A PING. DORMIMOS 6 SEGUNDOS EL
> PROCESO
>
> Thread.sleep(6000);
> contadorDormido=contadorDormido+6;
> Log.d("PRUEBA", "No responde a ping despues de mandar el
> paquete magico en..." + contadorDormido);
> Toast.makeText(getApplicationContext(), "No responde a
> ping despues de mandar el paquete magico en..." + contadorDormido,
> Toast.LENGTH_SHORT).show();
> Toast.makeText(this, "No esponde a ping despues de
> mandar el paquete magico en..." + contadorDormido,
> Toast.LENGTH_SHORT).show();
> Toast.makeText(ssh.this.getApplicationContext(), "No
> responde a ping despues de mandar el paquete magico en..." +
> contadorDormido, Toast.LENGTH_SHORT).show();
> ....................................
>
>
> And I can see the logcat
>
> Please any help?
> Many thanks
>
>
> On 9 abr, 11:49, Kostya Vasilyev <kmans...@gmail.com> wrote:
>> Are you sure this code actually runs, and calls Toast? Add logcat printouts
>> just before Toast to make sure.
>> 09.04.2011 13:13 пользователь "David Tabernero" <davidt...@gmail.com>
>> написал:
>>
>> > Hi,
>>
>> > I can't display Toast in my application:
>>
>> > I have this code but nothing happens. Any help please?
>>
>> > Many thanks and sorry for my english!
>>
>> > ....................
>> > ....................
>> > public void wakeonLan (){
>>
>> > try {
>> > while (pruebaPing(maquina)){
>> > Toast.makeText(ssh.this, "No responde a ping despues de
>> > mandar el paquete magico en..." + contadorDormido,
>> > Toast.LENGTH_SHORT).show();
>> > Toast.makeText(getApplicationContext(), "No responde a ping
>> > despues de mandar el paquete magico en..." + contadorDormido,
>> > Toast.LENGTH_SHORT).show();
>> > ................
>> > .................
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to android-developers@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > android-developers+unsubscribe@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment