http://android-developers.blogspot.com/2009/05/painless-threading.html
On Jul 31, 9:08 am, Marco Nelissen <[email protected]> wrote: > Can you be more specific than "it's not working" ?Does it crash? If so, post > the stack trace from the log. > > On Thu, Jul 30, 2009 at 11:20 AM, rizwan <[email protected]> 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)) ; > > } > > } > > > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

