Build 1.0_r1(from source)

android.media
Class Ringtone

java.lang.Object
  extended by android.media.Ringtone

public class Ringtone
extends Object

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:
RingtoneManager

Constructor Summary
Ringtone(Context context)
           
 
Method Summary
 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.
(package private)  void open(AssetFileDescriptor fd)
           
(package private)  void open(FileDescriptor fd)
           
(package private)  void open(Uri uri)
           
 void play()
          Plays the ringtone.
 void setStreamType(int streamType)
          Sets the stream type where this ringtone will be played.
(package private)  void setTitle(String title)
           
 void stop()
          Stops a playing ringtone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ringtone

Ringtone(Context context)
Method Detail

setStreamType

public void setStreamType(int streamType)
Sets the stream type where this ringtone will be played.

Parameters:
streamType - The stream, see AudioManager.

getStreamType

public int getStreamType()
Gets the stream type where this ringtone will be played.

Returns:
The stream type, see AudioManager.

getTitle

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.

open

void open(FileDescriptor fd)
    throws IOException
Throws:
IOException

open

void open(AssetFileDescriptor fd)
    throws IOException
Throws:
IOException

open

void open(Uri uri)
    throws IOException
Throws:
IOException

play

public void play()
Plays the ringtone.


stop

public void stop()
Stops a playing ringtone.


isPlaying

public boolean isPlaying()
Whether this ringtone is currently playing.

Returns:
True if playing, false otherwise.

setTitle

void setTitle(String title)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature