Android
android.media
public class

android.media.Ringtone

java.lang.Object
android.media.Ringtone

Ringtone provides a quick method for playing a ringtone, notification, or other similar types of sounds.

For ways of retrieving Ringtone objects or to show a ringtone picker, see RingtoneManager.

See Also

Summary

Public Methods

          int  getStreamType()
Gets the stream type where this ringtone will be played.
          String  getTitle(Context context)
Returns a human-presentable title for ringtone.
          boolean  isPlaying()
Whether this ringtone is currently playing.
          void  play()
Plays the ringtone.
          void  setStreamType(int streamType)
Sets the stream type where this ringtone will be played.
          void  stop()
Stops a playing ringtone.
Methods inherited from class java.lang.Object

Details

Public Methods

public int getStreamType()

Gets the stream type where this ringtone will be played.

Returns

public String getTitle(Context context)

Returns a human-presentable title for ringtone. Looks in media and DRM content providers. If not in either, uses the filename

Parameters

context A context used for querying.

public boolean isPlaying()

Whether this ringtone is currently playing.

Returns

  • True if playing, false otherwise.

public void play()

Plays the ringtone.

public void setStreamType(int streamType)

Sets the stream type where this ringtone will be played.

Parameters

streamType The stream, see AudioManager.

public void stop()

Stops a playing ringtone.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48