Wednesday, 10 December 2014

Change Dial drawable of Android Analog Clock dynamically[programmatically]



I am new to android programming and seem to stumble upon this problem for some time now, i have used android analog clock widget as standard widget for my clock app and used custom dials and hand as it was possible, but now the requirement has changed to give further dials and design for the clock, i was searching here and there but cant seem to grasp this.


Can i change the default attribute of analog clock of dial, minute hand and hour hand programmatically in the code? like is there something like:



AnalogClock ac = (AnalogClock) findViewById(R.id.analogClock1);
ac.setDial(R.drawable.clock_dial_2);


i did this and this is not possible, is there any other method or methodology that i am missing??


No comments:

Post a Comment