Tecnologia do Blogger.
RSS

[androidbrasil-dev] Thread não executa o método run

Fiz uma Activity de teste e ela não executa o método run da thread, alguém sabe me dizer porque? Onde que está o erro?
Pelo menos no meu LogCat deveria imprimir a mensagem do System.out.println

  1. package br.com.casaredo.forcadevendas;
  2.  
  3. import android.os.Bundle;
  4. import android.app.Activity;
  5. import android.view.Menu;
  6.  
  7. public class Teste extends Activity implements Runnable{
  8.  
  9.         @Override
  10.         protected void onCreate(Bundle savedInstanceState) {
  11.                 super.onCreate(savedInstanceState);
  12.                 setContentView(R.layout.activity_teste);
  13.                
  14.                 Thread t = new Thread();
  15.                 t.start();
  16.         }
  17.  
  18.         @Override
  19.         public boolean onCreateOptionsMenu(Menu menu) {
  20.                 // Inflate the menu; this adds items to the action bar if it is present.
  21.                 getMenuInflater().inflate(R.menu.teste, menu);
  22.                 return true;
  23.         }
  24.  
  25.         @Override
  26.         public void run() {
  27.                 // TODO Auto-generated method stub
  28.                 System.out.println("Executou o método RUN");
  29.         }
  30.  
  31. }

--
............
.Márcio Fornari 
.Bacharel em  Sistemas de Informação
.Contatos pelo Telefone: (49)8814 - 3378
.ou pelo e-mail: marciofornari@gmail.com

..........................................................................

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