So you want your Android application to be able to change the media volume settings when the user presses the hard key volume buttons on the phone.

The way to do this is to make sure that your Activity class gets a reference of the audio service and override the OnKeyDown() method and catch the keypress event.

Check out the following code:

Here is a quick function for you to disable or enable checkboxes using Javascript. The functon takes on two parameters, 1st is the checkbox object while the 2nd parameter is a boolean which is used to set a checkbox if it should be enabled or disabled.

To use the function,

do this disableCheckbox(document.form_name.checkbox_name, true);

This, provided that your html form tags look like this

I tried not using form tags and relied on the id attribute for the checkboxes but it seemed that it does not work. So, that is one tip for you. Hope anyone finds this useful.

Related Posts Plugin for WordPress, Blogger...