it is causing a problem in
Thread.sleep (2000);
but why ? please if any body explain

On Jul 30, 11:23 pm, riz <rizcs...@gmail.com> wrote:
> I m just trying to call drawScore method from another Thread .
> drawScore method just changes the text of textView but it's not
> working .any idea ?
>
> On Jul 30, 11:20 pm, rizwan <rizcs...@gmail.com> wrote:
>
>
>
> > it is not working . I don't know why please advise at your earliest. I
> > m stuck here .
>
> > public myclass extends Activity  implements ICounter{
>
> >         TextView view ;
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
>
> >         super.onCreate(savedInstanceState);
>
> >    view = new TextView(this);
> >     view.setTextSize(25);
> >     view.setTextColor(Color.YELLOW) ;
> >    view.setText("Starting Counter......" ) ;
> >    setContentView(view) ;
>
> >    CounterManager manager = CounterManager.getcounterManager() ;
> >    manager.setCounterListener(this);
> >    manager.start();
>
> >     }
>
> >         @Override
> >         public void drawScore(String Score) {
>
> >                 // TODO Auto-generated method stub
> >                 view.setText(Score ) ;
> >         }
>
> > }
>
> > public class counterManager implements Runnable{
>
> >         private static counterManager instance ;
> >         IForce force ;
> >         public static forceManager getcounterManager(){
>
> >                 if(instance == null)
> >                         instance = new CounterManager();
> >                 return instance ;
>
> >         }
> >         public void setCounterListener(IForce force) {
> >                 this.force = force ;
>
> >         }
>
> >         public void start(){
> >                 Thread t = new Thread(this) ;
> >                 t.start() ;
> >         }
>
> >         @Override
> >         public void run() {
> >                 // TODO Auto-generated method stub
>
> >          for(int counter = 0 ; counter <= 20 ; counter ++) {
>
> >                  try {
> >                         Thread.sleep(2000) ;
> >                 } catch (InterruptedException e) {
> >                         // TODO Auto-generated catch block
> >                         e.printStackTrace();
> >                 }
> >                  force.drawScore(String.valueOf(counter)) ;
> >          }
> >         }
>
> > }- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to