Questions tagged [chronometer]

In Android, Chronometer is a class that implements a simple timer. Chronometer is a subclass of TextView. This class helps us to add a timer in our app. You can give Timer start time in the elapsedRealTime() timebase and it start counting from that. If we don’t give base time then it will use the time at which time we call start() method. By default a chronometer displays the current timer value in the form of MM:SS or H:MM:SS.

302 questions
0
votes
2 answers

Checking Chronometer Time from Another Class Shortcut

I have a Chronometer in Class Apple. I want to check what time the Chronometer is at in Class Banana. I do not want to create a Chronometer in Class Banana, nor do I want to make an Apple Object in Class Banana. Is this possible? Thanks! Let me…
Evorlor
  • 7,263
  • 17
  • 70
  • 141
0
votes
2 answers

Creating a timer that counts up from a timestamp

What I am looking to do is create a timer that starts counting up from a given timestamp basically telling my how long it has been since this point in time. an example timestamp would be this 1365679237087 I was looking at the Chronometer but if i…
tyczj
  • 71,600
  • 54
  • 194
  • 296
0
votes
1 answer

Timer function in Service (kind of chronometer)

My intention is to create an timer which starts from 00:00:00 and hangs together with a recording function. This recording is done in a service so, the timer is also in the same service. If the app moves to the background, the recording and thus the…
Matthias Vanb
  • 923
  • 5
  • 14
  • 32
0
votes
2 answers

Android. Save and reestablish value of chronometer (reversing screen)

My question is rather simple, but i can't handle with him. I have chronometer field in my design. I want to save them for avoid lost value of time by revert the screen (recreate new activity) I use for save public Object…
user2105282
  • 724
  • 1
  • 12
  • 26
0
votes
1 answer

Play sound in Chronometer after 30 seconds has passed

I have this stopwatch that needs to play a sound after 30, 45 and 60 seconds pass. Here is my code: @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); …
lakyberry
  • 15
  • 1
  • 8
0
votes
3 answers

Android: Chronometer SetBase in minutes

Is there a way by which using the android chronometer class to set base of the chronometer in 15 minutes and from that period the times goes down until 0 seconds? I have tried with setBase(60000) but this isn't work.
Katherine99
  • 980
  • 4
  • 21
  • 40
0
votes
2 answers

Issue with Automatically horizontal scroll in TextView

I wanted to implement automatically horizontal scroll for the situation if my Text is too long. It worked when the activity is empty without anything focus on. But when I tried implement this in an activity with chronometers, it's not working. I…
IssacZH.
  • 1,457
  • 3
  • 24
  • 54
0
votes
1 answer

Android Chronometer, onChronometerTick

I'm developing an android app and I have a problem with the chronometer. And when the onChronometerTick method gets called, on the 60th second the TextView should get updated, but it gets updated on the 58th second the first time. And if you pause…
Peter
  • 21
  • 4
0
votes
1 answer

How to android device vibrate when it is in background?

In my app, I have to make it vibrate in time intervals defined by the user. Basically it has a chronometer that makes the device vibrate when it has reached the defined time. Currently I do that by reading the chronometer value and comparing it with…
androidevil
  • 9,011
  • 14
  • 41
  • 79
0
votes
1 answer

Why animation restarts on tick of the chronometer?

I have a class with a view for animation and a chronometer. This is the content of my onCreate method: chronometer = ((Chronometer) findViewById(R.id.clock_time)); chronometer.setOnChronometerTickListener(this); chronometer.start(); …
androidevil
  • 9,011
  • 14
  • 41
  • 79
0
votes
5 answers

How can I call a method from another class?

I can't figure out how to call the start(); method from a class I made It is in the same package and it is called Chronometer here is me class import java.lang.reflect.Method; import java.text.DecimalFormat; import…
user1762507
  • 772
  • 9
  • 32
0
votes
2 answers

Cannot cast from View to Chronometer

I did everything right, I guess? I saved the xml file, but have no idea how to solve this. I'm a newbie, pls help. Here's my xml code:
cgpa2.17
  • 309
  • 1
  • 3
  • 12
0
votes
1 answer

Creating a 01:00 Countdown Timer (Chronometer) in Eclipse

I implemented a Chronometer object in my Android Application. What is the simple code to create a 01:00 countdown timer, so the user has 1 minute to complete the current level?
Mike Garo
  • 5
  • 1
  • 5
0
votes
1 answer

Android: Chronometer counts really fast up

This is my code: public class BFragment extends SherlockFragment { private Button start; private View v; private Button reset; private Button pause; private TextView hourTextView; private TextView minTextView; private TextView secTextView; private…
moritzg
  • 4,266
  • 3
  • 37
  • 62
0
votes
0 answers

AsyncTask Example w/ Chronometer

I've got a Chronometer, but when I change my View (with ActionBar) it stops. I don't really understand how to use AsyncTask, and I didn't find a Tutorial. Is there something easy to solve my problem? I would really like an example with…
moritzg
  • 4,266
  • 3
  • 37
  • 62