-1

This is the code. The range is just a value that I use buttons to add or subtract to it. And once the value hits a barrier it makes the button unusable until it is off the barrier.

       Button button2 = (Button)findViewById(R.id.button2);
    if(range == 10001) {
        button2.setEnabled(false);
    }
    else {
        button2.setEnabled(true);
    }
    Button button3 = (Button)findViewById(R.id.button3);
    if(range == 1001) {
        button3.setEnabled(false);
    }
    else {
        button3.setEnabled(true);
    }
Sarju Thakkar
  • 73
  • 1
  • 2
  • 6

1 Answers1

0

Albeit the ambiguity of your question, I am assuming the following: you have created a dedicated process that you wish to keep running from initiation to exit of your program.
If this is the case, I would advise reading up on Daemon threads. Hope this helps, and best of luck to you.

(Further reading on concurrency: Oracle SE Tutorials).

Community
  • 1
  • 1
Zesty Memes
  • 442
  • 2
  • 11
  • Thanks i was going to delete this because after 10 mins i realized what i had to do but thanks anyway for your feedback. – Sarju Thakkar Mar 20 '15 at 01:52