AnalogClock - how do i set it to show 18:50 in my app and never change?

by Richard » Wed, 05 Aug 2009 00:21:38 GMT


Sponsored Links
 Hi

I would like to show an Analog clock in my android app and set it to a
specific time, say 18:50 and never change.
I have created an AnalogClock view and added it to the activity but it
only ever shows the current time and I can't find a function call
change it to the time I want. Is it even possible?

I would have assumed that it would be something like below but these
functions dont exist (or work that wat).

AnalogClock clock = (AnalogClock)findViewById(R.id.clock);

clock.setHour(18);
clock.setMinute(50);

or

clock.setTime("18:50");

or even

SimpleDateFormat df = new SimpleDateFormat("HH:mm");
Date myDateTime = df.format("18:50");

clock.setTime(myDateTime);

Am I barking up the wrong tree by trying to use the AnalogClock view
for something is not designed to do? If so is there a different way to
achieve what I want?

I guess I would need to extend the AnalogClock class to make it show a
specific time of my choosing. Problem is I wouldnt know where to
start.

I feel like I have missed something stupidly obvious but I have been
looking at it so long I cant see it :-)

Any help would be appreciated

Thanks

Richard

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Posted/Published Application, Now What?

So I've published my application, is there a URL which I can send
people to install it? Is there one which works in native web browsers
as well? Is there a delay during the publication process? (by the way
the application is called Pigs Can Fly Site Monitor , if you can find
it and give me some feedback as it is my first android application I
would be greatly appreciative)

Cheers,

Holden :)
--~--~---------~--~----~------------~-------~--~----~

2. publishing application

So I've published my application, is there a URL which I can send
people to install it? Is there one which works in native web browsers
as well? Is there a delay during the publication process? (by the way
the application is called Pigs Can Fly Site Monitor , if you can find
it and give me some feedback as it is my first android application I
would be greatly appreciative)

Cheers,

Holden :)

-- 
Cell : 226-747-0683

--~--~---------~--~----~------------~-------~--~----~

3. Sorry, I want to test whether I send an email to the group

4. Where is the "Website" field in the Contact application?

5. TIME_TICK in an AppWidget?

6. RTSP stack implementation

7. Port AbsoluteLayout to any other Layout to draw at x,y position