Document PreferencesActivity and VolumePreference

This commit is contained in:
Christopher Eby 2010-05-16 14:37:13 -05:00
parent c829534c74
commit 3388f4bbef
2 changed files with 15 additions and 0 deletions

View File

@ -24,7 +24,13 @@ import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.KeyEvent;
/**
* The preferences activity in which one can change application preferences.
*/
public class PreferencesActivity extends PreferenceActivity {
/**
* Initialize the activity, loading the preference specifications.
*/
@Override
protected void onCreate(Bundle savedInstanceState)
{
@ -40,6 +46,9 @@ public class PreferencesActivity extends PreferenceActivity {
ContextApplication.removeActivity(this);
}
/**
* Implement the long-press-back-quits-application behavior.
*/
@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event)
{

View File

@ -26,6 +26,12 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.SeekBar;
/**
* A preference that provides a volume slider dialog.
*
* The position in the slider is saved as float ranging from 0 to 3 on a
* roughly exponential scale.
*/
public class VolumePreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
public VolumePreference(Context context, AttributeSet attrs)
{