timer

EJB3.1 Timer cancel issue

三世轮回 提交于 2020-01-06 03:58:25
问题 I have a problem with EJB3.1 Timer service. I find this issue quite strange! I have a stateless session bean like below deployed on JBoss7.1.1 application server. import javax.annotation.Resource; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.ejb.Timeout; import javax.ejb.Timer; import javax.ejb.TimerService; import javax.interceptor.Interceptors; @Stateless @Local(HelloUserLocal.class) @Remote(HelloUserRemote.class) public class HelloUserBean

Executing code every x seconds

烂漫一生 提交于 2020-01-06 03:03:25
问题 Im creating a GUI interface where the user enters a nimber into a textfield, the number is then added as a parameter to an object of CurrentAccount. This number is then added or subtracted to a randomised value. I want this to happen every 5 seconds, taking the value after the equation has been completed and adding or subtracting a value until the user tells it to stop. So far i have created this code to decide if a random number should be added of subtracted, generate the random number, add

Show ProgressDialog between Dialogs

北战南征 提交于 2020-01-06 02:51:29
问题 I'm trying to mock up a USSD interaction in Android by creating a series of dialog menus that you can go through in Android. I'm trying to make it so that in between dialogs, there is a progress dialog that says "USSD code running..." However, upon clicking the positive button, when I try to run a ProgressDialog with a runnable timer and follow it with the next dialog called FirstTimeUser, they just layer one on top of another, even if I try to separate them with another timer. How can I make

How to set Timer when button clicked?

落花浮王杯 提交于 2020-01-06 02:30:09
问题 I mean is like stopwach, when button clicked the Timer is on until the stop button pressed startbutton= (Button)findViewById(R.id.black1); startbutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ //Start the timer } }); stopbutton= (Button)findViewById(R.id.black1); stopbutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ //Stop the timer } }); and second question, if timer show 90 second how to make it show imageview or button in

Timer stops every time the phone sleeps

懵懂的女人 提交于 2020-01-05 16:33:10
问题 I'm creating this incredibly simple app, since I'm just starting with Android and I have no experience with Java what so ever. Anyhow, all I have is a timer and a button. Obviously the button starts the timer which counts down from 60 ( 1 minute ) and then vibrates when it's done. All worked fine up until the point I decided to press the lock screen button to put the phone to sleep. I found out that the timer in my app stops going until I unlock the phone. This also happens if I set the auto

Timer stops every time the phone sleeps

我与影子孤独终老i 提交于 2020-01-05 16:32:22
问题 I'm creating this incredibly simple app, since I'm just starting with Android and I have no experience with Java what so ever. Anyhow, all I have is a timer and a button. Obviously the button starts the timer which counts down from 60 ( 1 minute ) and then vibrates when it's done. All worked fine up until the point I decided to press the lock screen button to put the phone to sleep. I found out that the timer in my app stops going until I unlock the phone. This also happens if I set the auto

Timer for online examination system to stores the time for each individual section

自闭症网瘾萝莉.ら 提交于 2020-01-05 15:14:36
问题 I am developing an online examination for which i need to have a countdown timer/clock to be displayed during the entire duration of the test. Also while displaying the final result the time taken to solve each individual questions should also be displayed along with the total time taken for the test. What are the possible best approaches to implement this functionality?? <?php $countfile = "counter.txt"; // location of site statistics. $statsfile = "stats.txt"; // checks whether the file

Timer for online examination system to stores the time for each individual section

放肆的年华 提交于 2020-01-05 15:14:06
问题 I am developing an online examination for which i need to have a countdown timer/clock to be displayed during the entire duration of the test. Also while displaying the final result the time taken to solve each individual questions should also be displayed along with the total time taken for the test. What are the possible best approaches to implement this functionality?? <?php $countfile = "counter.txt"; // location of site statistics. $statsfile = "stats.txt"; // checks whether the file

How to test “Timer code” in a GWTTestCase?

假装没事ソ 提交于 2020-01-05 14:27:50
问题 I am writing code using GWT, and I have created a java.util.Timer emulation , which I could like to test . In Java, I would create a Timer, fire a task on it, wait until the task was executed, and then return from successfully the unit test method (or fail, after some timeout expired). I don't know much about JavaScript (which is why I use GWT), but I have seen examples using the JavaScript "native" timer functions setTimeout()/setInterval(), where the handler/callback, used a flag to make

How to test “Timer code” in a GWTTestCase?

不羁岁月 提交于 2020-01-05 14:26:14
问题 I am writing code using GWT, and I have created a java.util.Timer emulation , which I could like to test . In Java, I would create a Timer, fire a task on it, wait until the task was executed, and then return from successfully the unit test method (or fail, after some timeout expired). I don't know much about JavaScript (which is why I use GWT), but I have seen examples using the JavaScript "native" timer functions setTimeout()/setInterval(), where the handler/callback, used a flag to make