Questions tagged [android-timer]

70 questions
1
vote
0 answers

Why is my app slow while I am using a handler and a simple view?

I am having issues with my application's speed. My app uses a handler with a timer that computes coordinates of different objects showed on the screen and invalidates a simple view. It works quite well when it is started but it takes 3 or 4 seconds…
BigT
  • 21
  • 3
1
vote
1 answer

How to make a count up timer from a specific date?

In my app user pick a date and time from a date and time picker (from the past dates) then I want to start a count up timer from that date and I need to run it in a service so that if my app killed, timer wouldn't stop. I've tried Chronometer and…
Parisa Baastani
  • 1,713
  • 14
  • 31
1
vote
1 answer

The Structure of a Service Class in Android - Questions and Check Work

I am currently resuming a project I had been working on, and starting from scratch to recreate it. However, upon creating a Service class, I noticed something - in my old project, a method inside the Service called onStartCommand contains all of the…
Studio2bDesigns
  • 578
  • 5
  • 12
1
vote
1 answer

Have a timer continue to next Activity

I have created a timer on my first activity and would like the timer to continue timing on the second activity. How do I go about doing this? Would I have to create a SharedPrefrence or create a new timer on the second activity. I just don't know…
AnonymousZA
  • 121
  • 1
  • 11
1
vote
0 answers

Stop Timer on return to previous Activity

I have created a timer that starts timing on a handleClick() and continues timing throughout the app. When I return to the firstActivity I would like the timer to stop in the onResume(). however whenever I return to the firstActivity I get the…
AnonymousZA
  • 121
  • 1
  • 11
1
vote
0 answers

viewpager images swipe

I am using Timertask for scrolling images with viewpager. I need to show all images after that it is automatically move to category wise (no click operation). public class GalleryActviity extends AppCompatActivity { Timer timer; …
kartheeki j
  • 2,206
  • 5
  • 27
  • 51
1
vote
0 answers

How to hold scroll position of RecyclerView while refreshing adapter?

I have created a multiple timer application. In that, I have use RecyclerView for showing each timer as a list. As per my logic every second, I call RecyclerView and refresh the screen for update the sec value and show it. But my issue is when the…
1
vote
2 answers

How to use Interval in countDownTimer in Android

In my application i should use CountDownTimer and for this I want use this library : CountdownView. I want when lasted 5s show me Toast. For example : I want show 17s countTimer, when this timer receive to 5s show me toast "just 5s". I use this…
OoO 3
  • 113
  • 1
  • 2
  • 8
1
vote
1 answer

Android timer app

Is it anyway possible that when I set a timer, it will still run even if I restart the phone? Like the alarm clock it is still there when I restart the phone. If it is possible can I get the code of it? I really need it.
1
vote
2 answers

How to run code in each time in android

I want show animation in my application, and i want show this animation each 3000m/s. I write below code, but in this code show just once. new Handler().postDelayed(new Runnable() { @Override public void run() { …
Dr. KoK
  • 13
  • 3
1
vote
1 answer

runOnUiThread not working properly

I am trying to create textview in android which display the remaining time(seconds). Have used runOnUiThread and Hadnler for this and everything seems working fine(sysout and debug shows that both threads are executed and value is updated…
Chota Bheem
  • 1,106
  • 1
  • 13
  • 31
1
vote
2 answers

Timer does not stop at old activity

I set a timer on AccountActivity.class to ensure that user does not press home button if not will start the countdown to logout the user or if the user locks his screen. But now I am facing an issue because of the onPause method. When my user…
iOSAndroid
  • 17
  • 1
  • 11
1
vote
0 answers

Creating a running Time separate from the System's Time

I want to disregard the Device Time and want to implement my own Clock inside my app. The time I need will be coming from the server. I have already set its Date and Time as follow: Date.setDate() and Date.setTime() Now, I just need to get my…
Dale Julian
  • 1,560
  • 18
  • 35
1
vote
3 answers

How can I check the duration after I click the button

I'm new to Java and Android, I would like to set up a time counter in my ACTION_UP event and cancel the timer while I do the other events. How can I basically set up a timer for that and stop and reset the timer for other event?
0
votes
1 answer

How to display a dialog inside TimerTask's run() after calling Looper.prepare();?

In activity's onCreate(), I arm a TimerTask that should display a dialog after 10 secs : public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { …
matdev
  • 4,115
  • 6
  • 35
  • 56